Prompt
Why does my scraper miss pages when crawling a large site?
Latest observation
Scrapers usually “miss pages” on large sites for one of a few common reasons:
1) The site doesn’t expose all URLs in static HTML
Many large sites load links dynamically with JavaScript, infinite scroll, or API calls. If your crawler only parses the initial HTML, it may never see some pages.
Signs:
- Pages appear in the browser only after scrolling/clicking
- View source doesn’t contain the links
- Network tab shows XHR/fetch calls
Fix:
- Use a browser automation tool (Playwright/Selenium) or
- Reverse-engineer the site’s API calls and crawl those directly
2) Your crawler stops too early
This happens when the logic for “done” is incorrect.
Common causes:
- Pagination links aren’t followed consistently
- URL filters accidentally exclude valid pages
- Crawl depth or page limit is too low
- Duplicate detection is overly aggressive
Fix:
- Log every discovered URL and why it was accepted/rejected
- Compare expected vs visited URL counts
- Review deduplication rules
3) Canonicalization issues cause pages to collapse together
Different URLs may point to distinct pages, but your crawler treats them as the same because of normalization.
Examples:
?page=2vs?page=2&sort=asc- Trailing slashes
- HTTP vs HTTPS
- Case differences
- Fragment identifiers
- Tracking parameters
Fix:
- Be careful with URL normalization
- Strip only truly irrelevant parameters
- Keep parameters that affect content
4) The site has multiple navigation paths
Large sites often have pages reachable via:
- category pages
- tags
- internal search
- related links
- sitemaps
If you only crawl one path, you’ll miss others.
Fix:
- Seed from sitemap.xml if available
- Crawl multiple entry points
- Use internal link discovery broadly
5) Rate limiting or blocking causes silent failures
The server may throttle you, return intermittent 403/429 responses, or serve incomplete content.
Signs:
- Missing pages cluster after many requests
- Some pages return unexpected redirects or errors
- Content differs based on request rate/IP/user-agent
Fix:
- Add retries with backoff
- Slow down request rate
- Rotate identities only if allowed
- Check response codes and body content, not just status 200
6) JS-rendered pages depend on timing
Even if you use a headless browser, the page may load content after delays, user interactions, or lazy-loaded components.
Fix:
- Wait for specific selectors or network idle
- Scroll/click as needed
- Capture API responses directly
7) Robots or access restrictions limit crawlability
Some sections may be blocked by:
robots.txt- login walls
- geo restrictions
- cookies/session requirements
Fix:
- Verify whether the pages are accessible to your crawler’s session
- Inspect robots rules and auth requirements
8) Bugs in the crawler pipeline
Issues can come from:
- queue management
- concurrency races
- premature process termination
- database dedup bugs
- parsing exceptions swallowed silently
Fix:
- Add structured logging and metrics
- Track queued, fetched, parsed, discovered, and failed URLs separately
- Make parse errors visible
A good debugging approach
- Pick a missed page and trace how it should have been discovered.
- Check whether the URL was:
- seen
- queued
- fetched
- parsed
- rejected
- Compare the missed page with similar pages that were found.
- Inspect raw HTML and network requests.
- Review dedup/filter rules and crawl termination logic.
If you want, I can help you debug it systematically if you share:
- your crawling approach,
- a sample missed URL,
- and the rules you use for deduplication/link extraction.
Brands