How does a search engine read the whole web?
A polite text file from 1994, written after one badly behaved robot knocked a server over, still tells every crawler where it may go.
βΆ Start the storyA search engine reads the web with a crawler: a program that starts from a list of known pages, downloads each one, notices every link on it, and adds those links to a to-do list of pages to visit next. Repeat that millions of times and a few starting points unfold into a map of the web. The pages it copies are handed to the search engine, which indexes them so that people can search them quickly.
The starting list is called the seeds, and the growing to-do list is the . The hard part is that the web is far too big and changes too fast. A crawler can only download a limited number of pages in a given time, so it has to prioritize, and by the time it returns, a page may have changed or vanished. Even the biggest engines index only part of the web: a 2009 study put it at no more than 40 to 70 percent of the indexable web.
Step 1: Start with seeds
A list of known pages to visit
Step 2: Download a page
Ask the for it and copy it
Step 3: Find its links
Spot every on the page
Step 4: Grow the frontier
Add new links to the to-do list
Step 5: Repeat
Take the next page off the frontier
Crawlers are also fast, much faster than human visitors, and that can be a problem for the websites they visit. In 1994, Martijn Koster proposed a simple fix after, as the story goes, a badly behaved crawler written by Charles Stross accidentally knocked over Koster's server. The fix was a plain text file called robots.txt that a site places at its root, listing which parts of the site robots may visit.
Well-behaved robots fetch that file before anything else on the site. But it is a request, not a lock. The standard relies on , and a bad robot can even read the file as a list of interesting places. Pages blocked in robots.txt can still show up in search results if other pages link to them.
Quiz me
0/3
Recap
A crawler follows links from seed pages and robots.txt is only a polite request, so no engine reads everything and no file locks anyone out.
π‘ A trick to remember it Β· A spider walks the web's threads link by link, and robots.txt is a polite sign on the door, not a lock.
Surprising fact Β· A photo gallery with a few options can show the same pictures under 48 different addresses, and a crawler has to avoid fetching them all.
Sources (2)
No source, no claim. Every fact in this lesson (17 claims) cites at least one of these.