Web Crawler
A program that discovers the web by fetching pages and following their links, the machinery behind search engines and training datasets, and the voluntary etiquette that governs it.
A web crawler is a program that explores the web automatically: it fetches a page, extracts its links, adds them to a list of pages to visit, and repeats. Search engines use crawlers to find and refresh the pages they index. Archives and dataset builders use them too. The narrower task of pulling specific data out of pages is usually called scraping.
The basic loop is a Graph Traversal over the web's link graph. The list of URLs waiting to be fetched is called the frontier. At web scale, every part of that loop becomes hard:
- Prioritization. The web is effectively infinite; a crawler must choose what to fetch next, favoring important pages and those that change often.
- Deduplication. The same content appears at many addresses, differing only in tracking parameters or capitalization. Crawlers normalize each URL and track what they've seen with compact structures such as a Bloom Filter; near-duplicate pages are caught by comparing content fingerprints.
- Traps. A calendar that links to next month forever, or a site that generates new URLs on every visit, can swallow a naive crawler.
- Freshness. Pages change. Crawlers can't revisit everything constantly, so they estimate how often each page changes.
Politeness keeps crawlers from overwhelming the sites they visit. A good crawler limits its requests per host, backs off when servers slow down, and identifies itself in its user-agent string; see Rate Limiting. An aggressive one is indistinguishable from an attack; see Denial-of-Service Attack.
Sites state their wishes in robots.txt, a plain text file at the root of a domain listing which paths each crawler may visit. Proposed in 1994 and finally standardized in 2022, it's entirely voluntary. It isn't access control, and it can point bad actors at the interesting paths. Sites can also offer a sitemap, an XML list of their pages, to help crawlers find everything.
How a page is built affects what a crawler sees. Crawlers that only read the initial HTML see nothing in a Single-Page Application that builds its content with JavaScript. Major search engines now render pages in a headless browser, but that's slower and done in a delayed second pass, so pages delivered as complete HTML through Server-Side Rendering or Static Site Generation get indexed sooner and more reliably; see Search Engine Optimization.
Crawled text is also raw material for AI. Nonprofit archives of crawled pages, spanning billions of pages and petabytes of data, form a large part of the corpus used in language-model Pretraining. That has reopened old questions about consent. Many sites now block AI crawlers by name in robots.txt, some crawlers ignore it, and the web's informal bargain, in which sites allowed crawling in exchange for search traffic, no longer clearly holds.
See also2
Canonical URL
The one preferred address for a page that's reachable at many, declared so search engines and other tools treat the copies as a single page, a hint introduced by the major search engines together in 2009.
Data & Content10 connections
Open Graph
The meta tags a page uses to describe its own preview card when a link is shared, how chat apps and social networks fetch them, and why a preview shows only what the page claims about itself.
Web Platform13 connections
Linked from8
- Canonical URLData & Content
The one preferred address for a page that's reachable at many, declared so search engines and other tools treat the copies as a single page, a hint introduced by the major search engines together in 2009.
- Denial-of-Service AttackNetworks & Distribution
Making a service unavailable by overwhelming it with traffic or expensive requests, usually from many machines at once, and the layered defenses that absorb or filter the flood.
- Internet ArchiveData & Content
The nonprofit digital library founded in 1996 that crawls and preserves the web through the Wayback Machine and also collects books, recordings, films, and software, at the center of fights over copyright and of what the web remembers.
- Open GraphWeb Platform
The meta tags a page uses to describe its own preview card when a link is shared, how chat apps and social networks fetch them, and why a preview shows only what the page claims about itself.
- SitemapData & Content
A list of a website's pages, either drawn for people as a map of its structure or published as an XML file that tells search engines what exists and when it last changed.
- User Agent StringWeb Platform
The header every browser sends to identify itself, which grew into a pile of mutual impersonations because sites served different pages to different browsers, and why it's being frozen.
- Web AnalyticsWeb Platform
Measuring how people use a website, from parsing server logs to JavaScript page tags and Google's free Analytics, with metrics like pageviews and bounce rate that are distorted by bots, blockers, and consent rules and easy to optimize in the wrong direction.
- Web Search EngineWeb Platform
A system that crawls the web, indexes what it finds, and ranks pages in answer to typed queries, the main way people have found things online since the late 1990s and one of the largest advertising businesses ever built.