Why your web crawler missed pages and how to debug it A Spidra tutorial lays out six states that explain why a web crawler misses expected pages — excluded, cut off, not followed, undiscovered, blocked and failed — and shows how to diagnose each by comparing a written list of expected URLs against a crawl report and a Map result. The walkthrough uses Spidra's crawler and Python client, installed via `pip install spidra` with an API key in the `SPIDRA_API_KEY` environment variable, and builds a `diagnose.py` script that normalizes URLs and classifies every missing URL. Spidra attributes each miss to a specific cause, such as hitting `max_pages`, a `robots.txt` disallow with `respect_robots` on, or a fetch error recorded as `status: "failed"` with an `error_message`. You crawled a site and the output is missing pages you expected, or it's full of pages you never wanted. This tutorial shows why a crawler misses pages and how to find the cause. You'll write down the URLs you expected, run a crawl with Spidra's crawler https://spidra.io/ai-crawler , read its crawl report, compare it with Map, and get a table that says what happened to every missing URL and what to change. You need Python, and a Spidra API key from the quickstart https://docs.spidra.io/quickstart in the SPIDRA API KEY environment variable. If you're new to crawling with Spidra, the Crawl API guide https://spidra.io/blog/spidra-crawl-api-guide covers the basics. pip install spidra Every missing page is in one of six states A crawler doesn't lose pages at random. For each URL you expected and didn't get, one of these happened: | State | What happened | Where you see it | Usual fix | |---|---|---|---| | Excluded | The crawl saw the link and declined it | The crawl report lists it with a reason | Your instruction, include paths , exclude paths or the start URL | | Cut off | The crawl stopped at max pages before reaching it | Map lists it, the crawl returned exactly max pages pages, the report doesn't mention it | Raise max pages or stop spending pages on things you don't want | | Not followed | The crawl never reached it, and it wasn't at the page limit | Map lists it, the report doesn't | Reword the instruction, or start from a page that links closer | | Undiscovered | Nothing links to it and the sitemap doesn't list it | Map doesn't list it either | Link it, add it to the sitemap, or scrape the URL directly | | Blocked | The site's robots.txt disallows it with respect robots on or the page won't load for a bot | The report says robots txt , or the page comes back failed | Honor the rule, or use Stealth Mode where that's appropriate | | Failed | The page was fetched but errored | The page has status: "failed" and an error message | Scrape it again on its own | The rest of this post builds a script that puts every expected URL in one of these rows. Write the list of URLs you expect first " Missed pages " only means something against a list. Without one you can only say "fewer than I hoped". Put the URLs in a text file, one per line. A sitemap, a Map result or your own knowledge of the site all work. For this walkthrough, the goal is to crawl the Spidra blog and get its posts. The list is ten posts: text the posts we expect a blog crawl to return https://spidra.io/blog/spidra-search-api https://spidra.io/blog/best-web-search-apis-ai-agents https://spidra.io/blog/how-to-scrape-pdf-extract-json-api https://spidra.io/blog/spidra-crawl-api-guide https://spidra.io/blog/spidra-batch-scraping-api https://spidra.io/blog/spidra-browser-actions-guide https://spidra.io/blog/spidra-foreach-structured-output-batch-scrape https://spidra.io/blog/scrape-structured-data https://spidra.io/blog/authenticated-scraping-and-crawling https://spidra.io/blog/captcha-solving-stealth-mode-crawling Before comparing, normalize the URLs so https://Example.com/a/ and https://example.com/a count as the same page. Start a file called diagnose.py with these imports and the two helpers. The later blocks append to it in the order shown: python diagnose.py import time from dataclasses import dataclass from urllib.parse import urlsplit python def normalize url : """Compare URLs without fragments, a trailing slash or host case.""" parts = urlsplit url.strip path = parts.path.rstrip "/" or "/" query = f"?{parts.query}" if parts.query else "" return f"{parts.scheme}://{parts.netloc.lower }{path}{query}" def load expected path : with open path, encoding="utf-8" as f: lines = line.strip for line in f return normalize line for line in lines if line and not line.startswith " " Compare your list with Map Map https://docs.spidra.io/map lists the URLs Spidra can see on a site, from its sitemap and its links, without scraping them. Checking your list against it tells you whether the pages are discoverable at all. If you want the broader picture of when to use Map, a crawl or a batch, Map a website and scrape only the pages you need https://spidra.io/blog/map-website-batch-scrape-selected-pages covers it. python check map.py import os from spidra import Spidra from diagnose import load expected, normalize client = Spidra api key=os.environ "SPIDRA API KEY" expected = load expected "expected urls.txt" site = client.map "https://spidra.io/blog", limit=500 mapped = {normalize link.url for link in site.links} print "Map found", site.total, "URLs" print "expected", len expected , "| in Map", sum url in mapped for url in expected for url in expected: if url not in mapped: print "not in Map:", url Output: Map found 17 URLs expected 10 | in Map 10 All ten are in Map, so discovery isn't the problem here. If a URL had been missing, it would belong in the Undiscovered row: nothing links to it, so no crawl will find it either. Map only reports what the sitemap and the site's links expose, so that's the cue to scrape the URL directly. Read the crawl report Every finished crawl has a crawl report https://docs.spidra.io/crawl that explains what it did. The fields you need are: - understood as : the kind of page the crawl looked for, from your instruction. If it isn't what you meant, reword the instruction. - navigation pages : pages read only to find the ones you wanted. They aren't returned or charged. - skipped urls : the declined URLs themselves, each with its reason and the page it was found on. Up to 2,000 are kept per crawl, and you page through them with limit and offset . The code below reads every skipped URL into a dictionary, and waits for the crawl to finish first: python def wait for crawl client, job id, every=5, tries=240 : for in range tries : job = client.get crawl job id if job.status in "completed", "failed", "cancelled" : return job time.sleep every raise TimeoutError f"crawl {job id} is still running" def read skipped client, job id, page size=500 : """The report's counts, plus every skipped URL it recorded up to 2,000 per crawl .""" skipped, offset = {}, 0 while True: response = client.crawl report job id, limit=page size, offset=offset report = response.report if report is None: raise RuntimeError "no crawl report yet: the crawl may still be running" for item in report.skipped urls: skipped normalize item.url = item.reason if len report.skipped urls < page size: return report, skipped offset += page size read skipped raises an error if there's no report yet the crawl is still running, or it ran before reports existed . The report only lists links the crawl saw and declined. A page the crawl never reached, because it ran out of max pages , appears nowhere in it. That's why the next step also needs the Map result. Label each expected URL First, a one-line remedy for each skip reason, the reasons that count as blocked, and a small record for each finding: FIXES = { "not relevant": "name the page type in crawl instruction, or fence it with include paths", "outside start path": "start higher up, or set crawl entire domain=True and add include paths", "outside domain": "set allow subdomains=True if it is a subdomain of the same site", "include pattern": "your include paths does not match this URL: widen it", "exclude pattern": "your exclude paths matches this URL: narrow it", "file type": "crawls skip images, video, archives and scripts: fetch the file directly", "other version or language": "start from the version or language you want, or add its path to include paths", "duplicate page": "the content came back under another URL: update your checklist", "redirected off site": "the link leaves the site: scrape the destination directly", "robots txt": "the site's robots.txt disallows it and respect robots is on", "action link": "links like add to cart or log out are never followed", } BLOCKED = {"robots txt"} @dataclass frozen=True class Finding: url: str label: str returned, excluded, blocked, failed, cut off, not followed or undiscovered detail: str = "" classify takes your list, the Map URLs, the pages the crawl returned, the skipped URLs and max pages , and decides which row each expected URL belongs in: python def classify expected, mapped, pages, skipped, max pages : returned = {normalize p.url : p for p in pages} mapped = {normalize u for u in mapped} wanted = set expected findings = for url in expected: page = returned.get url if page and page.status == "success": findings.append Finding url, "returned" elif page: findings.append Finding url, "failed", page.error message or "no error message" elif url in skipped: reason = skipped url label = "blocked" if reason in BLOCKED else "excluded" findings.append Finding url, label, f"{reason}: {FIXES.get reason, 'see the crawl report' }" elif url not in mapped: findings.append Finding url, "undiscovered", "not in the Map result either: nothing links to it" elif len returned = max pages: extra = sum 1 for u in returned if u not in wanted findings.append Finding url, "cut off", f"max pages={max pages} was used up, and {extra} of the returned pages are not on your checklist" else: findings.append Finding url, "not followed", "Map sees it but the crawl never reached it: raise max depth or reword crawl instruction" return findings The order of the checks matters. A returned page is a success or a failure. A skipped URL is excluded, or blocked when the reason is robots txt . Anything else is a page the crawl never touched: it's undiscovered if Map doesn't know it, cut off if the crawl hit max pages , and not followed otherwise. Run it on a crawl that missed pages The last two helpers count the findings and print them, grouped so a long list stays readable: python def summarize findings : counts = {} for item in findings: counts item.label = counts.get item.label, 0 + 1 return counts def print findings findings : counts = summarize findings found = counts.get "returned", 0 print f"{found} of {len findings } expected URLs returned" for label, count in counts.items : if label = "returned": print f" {label}: {count}" groups = {} for item in findings: if item.label = "returned": groups.setdefault item.label, item.detail , .append item.url for label, detail , urls in groups.items : print f"\n{label}: {detail}" for url in urls: print " ", url Here's the whole check as one script. It starts a crawl, waits, reads the pages and the report, maps the site, and prints the diagnosis: python crawl check.py import argparse import os from spidra import CrawlParams, Spidra from diagnose import classify, load expected, normalize, print findings, read skipped, wait for crawl ap = argparse.ArgumentParser ap.add argument "--start", default="https://spidra.io/blog" ap.add argument "--instruction", required=True ap.add argument "--max-pages", type=int, default=10 ap.add argument "--exclude", nargs=" " args = ap.parse args client = Spidra api key=os.environ "SPIDRA API KEY" expected = load expected "expected urls.txt" params = CrawlParams base url=args.start, crawl instruction=args.instruction, max pages=args.max pages, exclude paths=args.exclude job id = client.start crawl params .job id job = wait for crawl client, job id if job.status = "completed": raise SystemExit f"crawl {job.status}: {getattr job, 'error', None }" pages = client.crawl all pages job id report, skipped = read skipped client, job id mapped = link.url for link in client.map args.start, limit=500 .links print "returned", len pages , "pages | skipped", report.skipped total, "links" if report.understood as: print "understood as:", report.understood as print "navigation pages:", report.navigation pages for item in report.skipped: print " ", item.reason.ljust 20 , item.count print print findings classify expected, mapped, pages, skipped, args.max pages Run it with the instruction All pages and a limit of ten pages: python crawl check.py --instruction "All pages" --max-pages 10 Output: returned 10 pages | skipped 20 links navigation pages: 0 outside start path 20 3 of 10 expected URLs returned cut off: 7 cut off: max pages=10 was used up, and 7 of the returned pages are not on your checklist https://spidra.io/blog/spidra-crawl-api-guide https://spidra.io/blog/spidra-batch-scraping-api https://spidra.io/blog/spidra-browser-actions-guide https://spidra.io/blog/spidra-foreach-structured-output-batch-scrape https://spidra.io/blog/scrape-structured-data https://spidra.io/blog/authenticated-scraping-and-crawling https://spidra.io/blog/captcha-solving-stealth-mode-crawling Ten pages came back, but only three of them were posts. The crawl had a page limit of ten, and it spent seven of those pages on the blog index and the six category pages Trends, Announcements, Guides, Best Practices, Case Studies and Tutorials , because All pages means every page in that part of the site. Seven posts were cut off. The report lists no skipped post: the crawl stopped at its page limit before it reached them. The 20 outside start path links are pages like /pricing and /about . By default a crawl stays under the URL it started from, so a crawl of /blog doesn't wander into the rest of the site. That's correct here. If the pages you wanted were outside /blog , this row is where you'd see it, and the fix is crawl entire domain=True plus include paths . The instruction is a hint, not a filter A crawl instruction describes the pages you want. The crawl follows links it judges likely to lead to them, and it returns the pages that match. That makes it good at "individual blog posts" and unreliable as a boundary. For a hard boundary, use include paths , exclude paths , max depth and max pages . Naming the kind of page is the first fix to try. Run the same crawl with Individual blog posts : python crawl check.py --instruction "Individual blog posts" --max-pages 10 Output: returned 10 pages | skipped 55 links understood as: Individual blog post articles. navigation pages: 1 outside domain 32 not relevant 23 10 of 10 expected URLs returned All ten posts came back. understood as confirms how the instruction was read, the blog index was read as a navigation page and not returned, and the 23 not relevant links are links that didn't match the instruction. The second fix is a path filter. It needs no AI to decide what matches, so it's predictable: python crawl check.py --instruction "All pages" --max-pages 10 --exclude "/blog/category/ " Output: returned 10 pages | skipped 6 links navigation pages: 0 exclude pattern 6 9 of 10 expected URLs returned cut off: 1 cut off: max pages=10 was used up, and 1 of the returned pages are not on your checklist https://spidra.io/blog/captcha-solving-stealth-mode-crawling The six category pages are now exclude pattern , which is what you asked for. But nine of ten posts came back, and the diagnosis says why: All pages still returns the blog index, and it takes one of the ten slots. Raising max pages to 11 fixes that. Path patterns match anywhere in a URL's path, so /books/ also matches /catalogue/category/books/… . Check the exclude pattern and include pattern rows of the report when a filter removes more than you intended. | You see | Use | Why | |---|---|---| | Pages of the wrong kind in the output | A more specific crawl instruction | It names the page type, and understood as shows how it was read | | A section you never want | exclude paths | A hard rule, no AI involved | | Expected pages in another part of the site | crawl entire domain with include paths | Lets the crawl leave its start path, with a fence | | Pages cut off at the limit | A higher max pages | Navigation pages don't count, returned pages do | Blocked and failed pages Two rows in the table need a different fix: the crawl saw the page but it can't be read. Blocked. respect robots is off by default. When you turn it on, pages the site's robots.txt disallows are skipped with the reason robots txt , and classify reports them as blocked. That's the site's rule, so the fix is to leave the page out. If robots.txt disallows the start URL itself, the crawl fails with a message saying so. A start page that can't be read at all also fails the crawl with a reason and a hint, such as turning on Stealth Mode https://docs.spidra.io/options/proxies-and-captchas use proxy=True , and a failed crawl costs nothing. Failed. A page can come back with status: "failed" and an error message . classify keeps the message, so you see the reason next to the URL. Failed pages aren't charged. retry crawl page is not the fix here: it re-runs the extraction on a page that was fetched, and doesn't fetch it again. To get a failed page, scrape that one URL on its own, with Stealth Mode if the site blocks bots. The tests check the labels. This one builds a checklist with one URL in each of five states plus a returned one and checks classify puts each where it belongs. A second test covers cut-off: python def page url, status="success", error=None : return NS url=url, status=status, error message=error def labels expected, mapped, pages, skipped, max pages=10 : return {f.url: f.label for f in classify normalize u for u in expected , mapped, pages, skipped, max pages } def test every bucket : skipped = {normalize B : "exclude pattern", normalize C : "robots txt"} pages = page A , page D, "failed", "timed out" result = labels A, B, C, D, E, F , mapped= A, B, C, D, F , pages=pages, skipped=skipped assert result == {A: "returned", B: "excluded", C: "blocked", D: "failed", E: "undiscovered", F: "not followed"} Run the whole suite: python -m pytest -q test diagnose.py Output: ....... 100% 7 passed in 1.75s What this doesn't cover - Pages behind a login. A crawl only sees what a visitor sees. Pass your own session with cookies to crawl pages that need one. - Links that exist only in scripts. Map and the crawl report what the page and sitemap expose. A URL a site builds on click may never appear. - A list you can't write. The checklist is yours to maintain. If you have no list, start with Map and crawl what you find. - Skipped URLs past the first 2,000. The report keeps up to 2,000 per crawl; the counts by reason are always complete. Conclusion "Why did my crawler miss pages?" now has an answer you can check: a URL list, a Map baseline and a crawl report, joined into one table with the setting to change for each missing page. Most of that debugging is done by the crawler itself. Spidra's crawl report names how it understood your instruction, counts the pages it read only to navigate and doesn't charge for them , and lists every link it declined with a reason you can filter by. You describe the pages you want in plain language, and you keep hard fences include paths , exclude paths , max depth , max pages for the cases where plain language isn't enough. Map gives you the baseline in one call. Failed pages and failed crawls aren't charged, every plan has every feature, and the free plan includes 300 credits with no card, so you can run this on your own site before paying anything. Create a free Spidra account https://spidra.io/ , put your own URLs in expected urls.txt , and run crawl check.py against your site. If a page is missing, the output says which row it's in.