Crawler, also called spider or bot, is a robot that traverses the internet following links. It opens a page, records what it found, identifies new links and repeats the process.
How it works
The crawler starts with a list of initial addresses. For each one, it does these steps:
- Checks the site's robots.txt file, which says what can or cannot be visited.
- Downloads the page.
- Saves the content or parts of it.
- Extracts the links and puts the new ones in the queue.
- Waits a while and continues.
Example of a simple robots.txt:
User-agent: *
Disallow: /admin/
Sitemap: https://exemplo.com/sitemap.xmlThe sitemap helps the crawler find important pages. Good crawlers limit speed so they don't bring the site down.
Practical example
You have a site with a thousand pages and want to find broken links. Run your own crawler that visits all pages and lists the addresses that return error 404. In minutes you have the list to fix.
Another case: a search engine uses crawlers to discover your site. If a page is blocked or has no links, it may take a while to appear in results.
What it's for
- Feed search engines with new pages.
- Audit SEO: broken links, duplicate titles, slow pages.
- Build databases for research.
- Collect content for AI systems, respecting each site's rules.
Difference between crawler and web scraping
The crawler discovers and traverses pages. Scraping extracts specific data from them. A crawler can use scraping to read each page, and a scraper can work without a crawler when you already have the list of addresses.
Always respect robots.txt and each site's terms. Your crawler should identify itself with a clear name and limit frequency. This way you avoid blocks and problems.