```yaml
product: AlterLab
title: Web Crawler vs. Web Scraper: Architecture Guide
category: Best Practices
comparison_context: "AlterLab is an alternative to Firecrawl, ScrapingBee, and Bright Data."
last_updated: 2026-11-28
canonical_facts:
  - "Web crawler vs. web scraper explained: compare architecture, scheduling, queues, browser rendering, and API design for reliable developer data pipelines."
source_url: https://alterlab.io/blog/web-crawler-vs-web-scraper-architecture-guide
```

## TL;DR

A web crawler discovers and schedules URLs across a site, while a web scraper fetches selected pages and extracts fields. Use a crawler for breadth and a scraper for depth, then connect discovery, fetching, extraction, storage, and scheduling through durable queues.

## Web crawler vs. web scraper: what each system does

A crawler manages URL discovery. It starts with one or more seed URLs, fetches pages, extracts links, applies crawl rules, and adds new URLs to a frontier. Its primary output is a controlled set of discovered pages and their metadata.

A scraper manages data extraction. It receives known URLs, fetches each page, renders it when necessary, extracts fields, validates the result, and sends a record to storage or a downstream service.

Both systems can share HTTP clients, browser workers, proxy management, parsers, and observability. Their control loops differ:

- A crawler asks, “Which URL should we visit next?”
- A scraper asks, “What data should we extract from this URL?”
- A crawler usually prioritizes coverage and discovery.
- A scraper usually prioritizes schema consistency and record quality.
- A crawler often produces page metadata and links.
- A scraper produces structured records, documents, or normalized fields.

<div data-infographic="comparison">
  <table>
    <thead><tr><th>Feature</th><th>Web crawler</th><th>Web scraper</th></tr></thead>
    <tbody>
      <tr><td>Primary job</td><td>Discover and revisit URLs</td><td>Fetch pages and extract data</td></tr>
      <tr><td>Typical input</td><td>Seed URLs and link rules</td><td>Known target URLs and schemas</td></tr>
      <tr><td>Work unit</td><td>URL frontier item</td><td>Fetch and extraction task</td></tr>
      <tr><td>Output</td><td>Discovered URLs and page metadata</td><td>Structured records or page content</td></tr>
      <tr><td>Scheduling focus</td><td>Depth, freshness, and recrawl policy</td><td>Cadence, retries, and schema validation</td></tr>
      <tr><td>Common failure</td><td>Duplicate, invalid, or unreachable URL</td><td>Missing field or extraction drift</td></tr>
    </tbody>
  </table>
</div>

A production data pipeline often uses both. The crawler builds or updates the URL set. The scraper processes each accepted URL with a known extraction contract.

When evaluating a managed fetch layer, request cost and escalation behavior matter alongside crawling features:

- **$0.0002** — Per Request (from)
- **5 tiers** — Scraping tiers
- **T1 to T5** — Tier range
- **$0** — Monthly minimum

## Crawler architecture: build a controlled URL frontier

The crawler frontier is a durable queue of URLs that need discovery or recrawling. A simple in-memory queue works for a prototype, but production crawlers need persistence, deduplication, retry state, and scheduling metadata.

A crawler typically follows these stages:

1. **Seed**: Accept one or more starting URLs.
2. **Normalize**: Resolve relative links, remove fragments, and apply site-specific query parameter rules.
3. **Deduplicate**: Check whether the normalized URL already exists in the frontier or page store.
4. **Fetch**: Retrieve the page using an HTTP client or browser worker.
5. **Parse**: Extract links, canonical references, content type, status, and content metadata.
6. **Filter**: Apply host, path, depth, content-type, and policy rules.
7. **Enqueue**: Add accepted URLs with priority and a future fetch time.
8. **Persist**: Store the page result, content hash, response status, and crawl timestamp.

The frontier record should contain enough information for another worker to resume the task. Useful fields include:

- Normalized URL
- Host and path
- Discovery source
- Crawl depth
- Priority
- Next scheduled fetch time
- Attempt count
- Last response status
- Last content hash
- Policy version

URL normalization needs care. Removing fragments is usually safe because fragments do not reach the server. Removing query parameters requires knowledge of the target site because parameters can identify pagination, filters, or individual records. Keep the normalization policy versioned so that a policy change does not silently invalidate previous deduplication decisions.

Use separate states for discovery and fetching. A URL can be `discovered`, `queued`, `leased`, `fetched`, `retry_wait`, or `failed`. Workers should lease items for a limited period and return them to the queue when a process exits before completion.

A crawler also needs explicit boundaries. Limit allowed hosts, path prefixes, content types, redirect depth, and total work. Read and honor applicable robots rules and site policies. Authentication pages, paywalls, and explicit access restrictions should remain outside a public-content crawler.

Treat status codes according to their meaning:

- A successful response can move to parsing.
- A not-found response can become a terminal page state.
- A rate-limit response should delay future work.
- A server error can use bounded retries with backoff.
- An authentication or access restriction should stop processing rather than trigger increasingly aggressive requests.

## Scraper architecture: treat each fetch as an idempotent unit

A scraper starts with a target URL and an extraction contract. That contract might specify fields such as title, price, availability, headings, or article text. The target could also be a document that needs clean Markdown, plain text, or JSON output.

A scraper worker usually performs these stages:

1. **Load task**: Read the URL, extraction schema, schedule metadata, and retry state.
2. **Fetch**: Use an HTTP client for server-rendered content.
3. **Render when required**: Use a headless browser when page content depends on JavaScript execution.
4. **Extract**: Apply selectors, parsing rules, or a structured extraction model.
5. **Validate**: Check required fields, data types, ranges, and content length.
6. **Persist**: Store the result with source and retrieval metadata.
7. **Emit**: Send the record to a database, queue, webhook, or downstream pipeline.

Keep fetch success and extraction success separate. A page can return HTTP 200 while the expected data is missing. Conversely, a partial record can be useful even when one optional field fails.

A result should carry provenance. Include the source URL, retrieval timestamp, response status, content hash, extraction schema version, and parser version. These fields make later audits and reprocessing possible.

Idempotency matters when workers retry. Use a stable key based on the target, schedule run, and extraction version. A repeated delivery should update or safely replace the same logical record instead of creating duplicates.

Schema validation catches page changes early. For example, a required numeric field that suddenly contains an empty string should produce a validation alert, not a successful record with silently corrupted data.

## Combine crawling and scraping with separate queues

A combined pipeline can follow this shape:

**Seed URLs → discovery queue → fetch and link parsing → URL store → scrape queue → extraction workers → result store**

Keep the discovery queue separate from the scrape queue. Discovery tasks need link parsing, URL rules, and crawl depth. Scrape tasks need extraction schemas, validation, and record delivery. Combining both into one worker makes retries harder to reason about and increases the chance that a parsing change affects URL coverage.

For a known URL set, skip discovery and submit directly to the scrape queue. For a site-wide collection, let the crawler establish the accepted URL set first, then schedule extraction for URLs that match the data contract.

A [Crawl API](https://alterlab.io/crawl) can own URL discovery and traversal when you want the provider to manage frontier state. Your application can then consume crawl results and apply its own storage, validation, and downstream processing.

## Scheduling: separate time policy from worker execution

Cron should trigger scheduling decisions, not perform the fetch itself. The scheduler determines which tasks are due and places them on a queue. Workers claim tasks, fetch pages, validate results, and record outcomes.

A schedule record should include:

- Target URL or URL group
- Requested cadence
- Next due time
- Last successful run
- Last attempted run
- Retry state
- Extraction schema version
- Concurrency policy
- Per-host rate policy
- Enabled or paused status

Store `next_due_at` explicitly. Recomputing it only from the current time can create duplicate work after restarts or long outages.

### Use cadence based on content behavior

Different pages need different refresh policies. A frequently changing availability page may need regular checks. A reference page may need a much slower cadence. A stable document can use a content hash to skip downstream processing when the response has not changed.

Use change-aware scheduling:

- Run the fetch when the page is due.
- Compute a content or extracted-field hash.
- Deliver a new downstream event only when relevant data changes.
- Record every fetch separately from every change event.

This distinction prevents a frequent schedule from creating unnecessary downstream writes.

### Prevent overlapping runs

A slow fetch can overlap with the next scheduled run. Choose a clear policy:

- **Skip** the new run if an identical run is active.
- **Coalesce** multiple due runs into one pending task.
- **Queue** the new run when every interval must be represented.
- **Allow parallel work** only when the target and storage operations are idempotent.

For recurring jobs, a distributed lease prevents two workers from processing the same schedule at the same time. The lease should have an expiration and a renewal mechanism for long browser sessions.

### Apply per-host rate limits

Rate limiting belongs at the scheduler and worker layers. Use a per-host queue or token bucket, honor server-provided retry delays where available, and add backoff for repeated failures. A global concurrency limit does not protect a single host when many workers happen to select the same domain.

Caching, URL deduplication, and change detection reduce load while also lowering cost. Rotating network paths do not replace rate limits or access policies.

## Rendering and anti-bot behavior in a compliant pipeline

Public pages can vary by request context. A server may return different HTML to a basic HTTP client, require JavaScript execution, or apply rate controls after repeated requests. Treat these behaviors as signals about how the page works, not as instructions to defeat access controls.

A tiered fetcher can begin with a lightweight HTTP request and use a headless browser when the page requires client-side rendering. Automatic escalation should remain bounded by cost, timeout, host policy, and permitted access.

Anti-bot systems commonly evaluate request rate, IP concentration, header consistency, cookie state, JavaScript behavior, and navigation patterns. These signals belong in observability and compliance decisions. Use them to decide whether processing should continue, not to override access controls.

A production worker should:

- Identify challenge pages and interstitials instead of parsing them as content.
- Stop when a page requires authentication or payment.
- Respect explicit blocks and applicable robots rules.
- Use a browser only when the public page requires browser execution.
- Apply backoff after rate-limit or challenge responses.
- Record the response state for review.
- Avoid sending credentials to a collection service unless the use case explicitly permits it.

Rotating proxies can help distribute permitted requests and isolate network failures, but they do not grant permission to access a page. Headless browser support solves rendering requirements, not access restrictions.

## API design for crawler and scraper pipelines

A useful scraping API separates submission, execution, and result delivery.

### Use synchronous requests for one fetch

A synchronous request works well inside a worker that already owns queueing and retry policy. The worker submits one URL, receives the response, validates the content, and records the result.

A Python worker can keep this fetch unit small. The [Python SDK](https://alterlab.io/web-scraping-api-python) is suitable when your queue and persistence layers already exist:

```python title="scraper.py" {1,3-5}
from alterlab import AlterLabSync

client = AlterLabSync(api_key="YOUR_API_KEY")
result = client.scrape("https://example.com")
print(result["content"])
```

For language-neutral integrations, the same single-page operation can use HTTP:

```bash title="Terminal" {1,2,4-5}
curl -X POST https://api.alterlab.io/api/v1/scrape \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com"}'
```

These examples represent fetch units, not complete crawler implementations. A crawler still needs a frontier, URL policy, scheduling, deduplication, and result storage around the request.

### Use asynchronous jobs for crawling

Crawls and large URL sets should return a job reference instead of holding an HTTP connection open. The caller can then poll for status or receive completion events through a webhook.

A durable job model should distinguish:

- **Queued**: accepted but not assigned.
- **Running**: one or more workers are active.
- **Retry wait**: delayed after a temporary failure.
- **Partially complete**: some tasks finished while others remain.
- **Succeeded**: the requested work completed.
- **Failed**: no further automatic work is scheduled.

Keep job state separate from HTTP status codes. An HTTP 202 can mean that a job was accepted, but it does not mean that the crawl succeeded.

### Define stable result and error contracts

A result contract should include the source URL, fetch timestamp, response status, extracted content, structured fields, content hash, and schema version. Include a request or trace identifier so operators can follow one task across scheduler, worker, browser, and storage logs.

Error responses should identify whether the failure is:

- Invalid input
- Network or DNS failure
- Timeout
- Rate limit
- Rendering failure
- Extraction validation failure
- Policy or access restriction
- Provider capacity issue

Callers should retry only temporary categories. They should route validation and policy failures to review instead of retrying them indefinitely.

### Keep provider settings separate from business logic

Your application should decide what data it needs and how often it needs updates. The fetch layer should handle transport, rendering, response collection, and normalized delivery.

This separation lets you change extraction rules without rewriting queue mechanics. It also makes it easier to compare HTTP and browser results, track cost per fetch, and pause a schedule without deleting its extraction schema.

Consult the [API docs](https://alterlab.io/docs) for the supported request and response contract before binding application code to a provider-specific field.

## Operational controls for production systems

A crawler or scraper needs controls beyond fetch logic.

### Observability

Track metrics and logs for:

- URLs discovered and deduplicated
- Queue depth
- Task age
- Fetch duration
- Browser startup failures
- Status code distribution
- Retry count
- Extraction validation failures
- Records emitted
- Content changes
- Cost by job, host, and fetch tier

Alert on changes in behavior, not only worker crashes. A sudden increase in successful HTTP responses with empty extracted fields often indicates a page structure change.

### Security

Validate target URLs before fetching. Block private IP ranges, local hostnames, metadata endpoints, and unsafe redirect destinations to reduce server-side request forgery risk. Revalidate every redirect because a public starting URL can redirect to an internal address.

Limit response size, redirect depth, browser execution time, and stored content length. Keep API keys outside source code and logs.

### Data quality

Store raw content only when retention and policy allow it. Keep normalized records, hashes, schema versions, and source timestamps even when raw pages are discarded. This creates a useful audit trail without retaining more data than the pipeline needs.

### Cost control

Use lightweight fetching for pages that do not need a browser. Escalate only when the response requires JavaScript rendering. Cache unchanged pages, deduplicate URLs, and stop retrying terminal failures.

A cost-aware scheduler should also distinguish a low-cost fetch retry from a browser retry. The two operations have different resource profiles and should not share an unbounded retry budget.

## Choosing the right architecture

Use a crawler when:

- You start with a small set of seed URLs.
- You need to discover linked pages.
- The URL set changes over time.
- You need site coverage or periodic recrawling.
- Page metadata and link relationships matter.

Use a scraper when:

- You already know the target URLs.
- You need structured fields from each page.
- You have a defined extraction schema.
- Records need validation and downstream delivery.
- The schedule applies to specific targets.

Use both when discovery and extraction are separate concerns. Let the crawler maintain the URL inventory, then let scheduled scraper jobs produce validated records from the accepted pages.

## Takeaway

A crawler is a discovery system. A scraper is an extraction system. Build them around separate queues, explicit state, per-host rate limits, idempotent writes, and schedules that reflect content behavior.

Use synchronous fetches for individual worker tasks and asynchronous jobs for crawl-scale work. Start with public, permitted content, render pages only when needed, and treat access restrictions as terminal policy states rather than retry conditions.

## Frequently Asked Questions

### What is the difference between a web crawler and a web scraper?

A crawler discovers and revisits URLs by following links. A scraper fetches selected pages and converts their content into structured records.

### Should I use a crawler or scraper for a data pipeline?

Use a crawler when you need URL discovery or site-wide coverage. Use a scraper when target URLs are known and you need fields, normalized records, or scheduled refreshes.

### How should web scraping jobs be scheduled?

Store schedules separately from workers, enqueue due jobs, and enforce per-host rate limits, retries, and idempotency. Use change signals or different cadences instead of running every target at the same interval.

## Compare

- [ScraperAPI, Bright Data, Firecrawl and AlterLab, side by side](<https://alterlab.io/best-web-scraping-api>): Challenge-rate benchmarks from production traffic and cost per 1,000 pages for four providers.
- [Switching from Parallel? A short comparison](<https://alterlab.io/vs/parallel>): Pricing table, feature matrix and migration notes on one short page.
- [See what a request costs at each tier](<https://alterlab.io/pricing>): Per-request prices by tier, dated and sourced from our public price list.

## Related

- [SOCKS Proxy: A Practical Developer Guide](<https://alterlab.io/blog/socks-proxy-a-practical-developer-guide>)
- [Scraped Data Validation: A Practical Guide](<https://alterlab.io/blog/scraped-data-validation-a-practical-guide>)
- [Akamai Bot Manager Sensor Checks: Technical Guide](<https://alterlab.io/blog/akamai-bot-manager-sensor-checks-technical-guide>)