Web crawler
- Goal
- Discover and visit pages
- Output
- A list or index of URLs and their content
- Scope
- Whole sites or the web
- Examples
- Googlebot, Bingbot, SEO audit tools
A web crawler (also called a spider or bot) is a program that discovers web pages by fetching a page, collecting its links and following them, over and over. Search engines use crawlers such as Googlebot to find and index the web; companies use them to map their own sites or collect public data.
A crawler starts from seed URLs and keeps a queue of pages to visit, called the frontier. For each URL it checks robots.txt, fetches the page, extracts links, normalises them, drops ones it has already seen and adds the rest to the queue. Sitemaps give it extra URLs directly. A scheduler decides what to fetch next and how fast each host may be hit.
Crawling and scraping are often mixed up. A crawler is about discovery: finding URLs. A scraper is about extraction: pulling specific data out of pages. Most real projects do both.
robots.txt is the long-standing convention for telling crawlers what they may fetch, standardised as RFC 9309 in 2022. Python's standard library reads it for you:
from urllib import robotparser
rp = robotparser.RobotFileParser("https://example.com/robots.txt")
rp.read()
print(rp.can_fetch("MyCrawler/1.0", "https://example.com/products/"))
print(rp.crawl_delay("MyCrawler/1.0")) # None if the site sets noneLarge crawls send many requests, and sites limit requests per IP. Proxies spread the load across IPs and let a crawler fetch pages as they appear in other countries. They do not change the rules of politeness.
CleanProxies rotating residential proxies rotate the IP on every request across 190+ countries; static ISP proxies suit steady crawls of the same sites with unlimited bandwidth.
Retry-After.The CleanProxies proxy that fits best here, with a $4.99 trial to test it first.
Rotating or sticky residential IPs in 190+ countries, with data that never expires.
Residential IPs in 190+ countries with country, state and city targeting. Rotate on every request or hold a sticky session for up to 24 hours; GB never expire.
Setup guides and best practices from the CleanProxies blog.
Terms that come up alongside Web crawler.
Straight answers about Web crawler.
A crawler discovers pages by following links; a scraper extracts specific data from pages. Many tools do both: crawl to find product pages, then scrape each one.