spire-core
Check out other spire projects here.
The crawl engine behind spire: the
crawler, its frontier, backends, workers and datasets.
Overview
- A
Backendhands out aClientper request: an HTTP client, a pooled browser session, or anything else that turns a request into a response. - A
Workerhandles each request and returns anOutcome: continue, retry, back off, stop or fail. - The
Frontierholds theSeeds waiting to be crawled. Facades add deduplication, a depth limit, retries and per-tag backoff on top of any storage. - The
Crawlerruns requests concurrently until the frontier is empty and nothing is in flight.
Crawls are bounded and polite: crawl scope (allow_hosts, filter), request
and time budgets, per-request deadlines, per-host concurrency and delays, and
robots.txt with the robots feature. With the serde feature, seeds are
serializable, so a stopped crawl's frontier and seen set can be snapshotted
and restored, and JsonlDataset writes results as JSON Lines.
Feature Flags
robots: fetch and obey robots.txt withCrawler::with_robots.serde: serializableSeedandFingerprint, andJsonlDataset.
Most users depend on spire, which adds a router, handlers and extractors on
top of this crate. Depend on spire-core directly to implement a backend, a
frontier or a dataset.
Example
use Noop;
use FrontierExt;
use InMemFrontier;
use Seed;
use ;
use ;
async
# async