Glossary
Crawler: the program that walks the web
A crawler, also called a spider or bot, is a program that visits web pages, records what it finds and follows links to new pages according to its rules.
Definition
Where web crawling names the process, a crawler is the software doing it. Search engines run the largest ones, but crawlers also power link checkers, archive projects, SEO audits, price monitors and internal search for company intranets. Frameworks such as Scrapy, Crawlee and Colly provide the moving parts so you only write the site specific logic.
The parts of a crawler
- Scheduler: holds the frontier and decides what to fetch next.
- Fetcher: an HTTP client or headless browser with timeouts, retries and connection pooling.
- Parser: extracts links for the scheduler and, if scraping, the data you want.
- Politeness module: rate limits per host and robots.txt checks.
- Storage: what was fetched, when, and with which result.
Politeness
A polite crawler behaves like a considerate guest on someone else's server. The basics have been stable for decades:
- Read robots.txt and respect the rules for your user agent. See robots.txt.
- Limit concurrency per host, often one or two connections, and add a delay between requests. Honor
Crawl-delaywhere present. - Back off on errors. A 429 or 503 means slow down; apply exponential backoff rather than retrying instantly.
- Identify yourself where appropriate, with a user agent string that names the bot and a contact URL, especially for research crawls.
- Crawl off peak for small sites, and cache so you do not fetch unchanged pages again.
- Use conditional requests with
If-Modified-SinceorIf-None-Matchto save bandwidth on both sides.
How sites tell crawlers apart
Site operators welcome some crawlers and limit others. Well known search engine bots can be verified by reverse DNS lookups on their IPs, so a fake "Googlebot" user agent from a random server is easy to spot and usually blocked. Unknown crawlers are judged by behavior: request rate, the spread of URLs, missing assets, and client fingerprints. Fast, regular, asset free traffic from a hosting network is the pattern most likely to be challenged.
Measuring a crawl
Track a few numbers per host: pages fetched, new URLs discovered, error and challenge rates, and median response time. Rising response times are an early sign that you are loading the server, so slow down before it starts refusing you. A falling discovery rate tells you the crawl is nearly complete, or that it has wandered into duplicate content.
Crawlers and CAPTCHAs
A challenge interrupts a crawl at one URL, but a careless crawler turns it into a cascade: it keeps fetching, receives more challenge pages, parses them as content and floods its frontier with junk. Detect challenges explicitly by status code and page markers, pause that host, and handle the challenge. Frameworks make this a middleware concern; the Scrapy CAPTCHA middleware guide shows one design.
To solve, send the widget's parameters to a task such as reCAPTCHA v2 or Cloudflare Turnstile, poll every 3 seconds until the status is ready, and retry the page with the answer. Failed tasks cost nothing, which keeps retry logic simple. Polite pacing reduces how many challenges you meet in the first place, and is cheaper than any solve.
Common questions
Is a crawler the same as a spider or bot?
Yes, the terms are used interchangeably for programs that traverse websites automatically.
Does a crawler have to obey robots.txt?
Robots.txt is a convention rather than a technical barrier, but respecting it is expected of polite crawlers and often matters legally.
How fast should my crawler request pages?
Keep it gentle per host, often one request every second or slower for small sites, and back off on 429 or 503 responses.
Can I pretend to be Googlebot?
It rarely works, since sites verify search bots by reverse DNS, and a fake search bot user agent usually draws a block.
How should a crawler detect a CAPTCHA page?
Check status codes and known markers such as challenge scripts or widget elements, then pause the host and solve before retrying.
Keep reading
- Web crawlingWeb crawling discovers pages by following links outward from seed URLs, managed through a crawl frontier that decides what to fetch next.
- robots.txtThe plain text file at the root of a site that tells crawlers which paths to avoid and how often to visit.
- ScrapyThe Python crawling framework built on spiders, a scheduler and middlewares, made for large structured crawls.
- Handle CAPTCHAs in a Scrapy middlewareAn async downloader middleware that spots a challenge response, solves it through the API and reschedules the request, keeping spiders clean.