Every topic so far has started from a collection that already exists. The thesis student's Arctic documents and the 10,788 Reuters stories were on disk before the first query was typed. On the web, someone has to build the collection first, by downloading pages one at a time from millions of servers that owe the downloader nothing. This topic sets out how a program gathers such a collection without harming the servers and without drowning in copies and traps, and how far it can know what it has missed.
A web crawler is the program that does this. It starts from a few known pages, fetches them, extracts their links, and follows those links to new pages, indefinitely.
Stated that way, crawling is breadth-first search on a graph, and a toy crawler takes an afternoon to write. The difficulty is everything around the search:
- The graph is effectively infinite, since programs generate pages on demand.
- The servers belong to other people, who may not want to be visited often or at all.
- Much of the web is copied, and much of it changes after it has been fetched.
- Much of it cannot be reached by following links at all.
A crawler that runs for months has to cope with all of it without harming the sites it visits.
The course treated crawling briefly, as the stage that feeds the indexing and ranking methods of the earlier topics. This topic follows the same outline in four steps:
- What a crawler does. The crawl loop, and the two duties every crawler has: to survive the web and to be polite to it.
- How a crawler is built. The modules a URL passes through, the frontier that orders the crawl, the test that spots copies, and the schedule for revisiting pages.
- The web beyond the crawl. What links cannot reach, how a crawl is spread over many machines, and the two classical methods of link analysis that a crawl makes possible.
- In practice. The case most people meet: a small, polite program that watches a few specific pages for changes.
Two small examples recur. A six-page toy web, with a university, a library and an endless calendar, shows the crawl loop and its traps. A crawl of this site's own pages, run on a local copy, shows the same steps on real HTML. PageRank and HITS share a five-page web of their own, small enough to solve by hand.
Articles
What a crawler does
- What a web crawler does: what a crawler does, step by step, and what it must guard against. The crawl loop traced on the toy web with its spider trap, the parts of a URL, the features a crawler must provide (robustness and politeness) and should provide (quality, scale, efficiency, distribution, freshness, and extensibility), and the bow-tie shape of the web graph, which decides what a crawl from given seeds can reach.
- Politeness and robots.txt: how a crawler avoids burdening the sites it visits, and how sites say what they allow. Rate limits and what they cost a crawler, identifying the crawler, and the Robots Exclusion Protocol as standardized in RFC 9309, with the longest-match rule worked on an example file.
How a crawler is built
- Crawler architecture: how the short crawl loop becomes a program that fetches hundreds of pages a second and stays polite to every host. The modules of a crawler, URL normalization, the URL frontier with its priority and politeness queues traced step by step and in an interactive demo, crawl ordering and focused crawling, and a crawl of this site.
- Near-duplicate detection: how a crawler tells that two pages are nearly the same, among billions. Fingerprints, shingling, the Jaccard coefficient, estimating it with MinHash (with the proof that the estimate is unbiased), banding and its S-curve, and simhash, each worked by hand on two sentences.
- Freshness and recrawling: how often a crawler should revisit each page when its budget of fetches is fixed. Page changes as a Poisson process, expected freshness and age derived and checked by simulation, why visiting pages in proportion to their change rate loses to visiting them equally, and the optimal rates found by a Lagrange multiplier.
The web beyond the crawl
- The deep web: how much of the web following links can never reach, and how a crawler reaches some of it. Content behind logins, forms, and scripts, what the size estimates measured and how sizes are estimated by capture and recapture, and the routes in: surfacing forms with the informativeness test, rendering scripts, and sitemaps.
- Distributed crawling and connectivity servers: how one crawl is divided among many machines, and how the link graph it finds is kept small enough to query. Assigning hosts with consistent hashing, exchanging links and fingerprints between nodes, and compressing link lists with locality, gaps, and shared menus.
- PageRank: how the links alone give a score of which pages matter most. The random surfer, the link matrix made stochastic and then given teleportation, the Perron-Frobenius argument for a single answer, power iteration and its convergence rate, the surfer as a Markov chain, and personalized PageRank, all worked through on a five-page web with an interactive demo.
- HITS: Hubs and Authorities: how the links of a small graph built for one query give each page two scores, as a source and as a guide to sources. The root set and base set, the two updates as power iteration on a symmetric matrix with the proof that it converges, the singular value decomposition, the five-page web computed to convergence, and the comparison with PageRank and SALSA.
In practice
- Monitoring websites: how a small program watches a few pages for changes without burdening the sites, and how often it should check. Feeds and interfaces first, conditional requests, fingerprints of only the part that matters, and what more frequent checks cost.
Related topics
- Search engine architecture places crawling in the full pipeline.
- Index construction covers the distributed indexing that follows a large crawl.
- Search at scale discusses how freshness of the index depends on the crawl.
- How web search answers a query uses the link analysis and duplicate removal described here.
Course materials
The course had no programming assignment for this topic. Each article ends with worked problems, drawn from the exercises of the course text's chapters 19 to 21 where it has them and otherwise posed on the article's own examples. The experiments in these articles crawl a local copy of this site, never an outside server, and are in tools/experiments/crawling/ in the site repository.
References
- Manning, C. D., Raghavan, P., and Schütze, H. (2008). Introduction to Information Retrieval, chapters 19–21. Cambridge University Press. record · 102 pages
- Croft, W. B., Metzler, D., and Strohman, T. (2010). Search Engines: Information Retrieval in Practice, chapter 3. Addison-Wesley. record · 12 pages
- Olston, C., and Najork, M. (2010). Web crawling. Foundations and Trends in Information Retrieval, 4(3), 175–246. record · 3 pages
Reviewed: verified, 16 Nov 2026 · citations checked, 16 Nov 2026 · editorial review, 16 Nov 2026 · 7 revisions