You changed your scraper. It came back with 488 products. Is that right?
On a real site you can’t know. Maybe the shop has 488. Maybe it has 495 and seven sat on a page your pagination never reached. Maybe it has 480 and you counted eight twice. The number looks plausible either way, and plausible is what slips through to production.
So we built a site where the number is written down. test.netweir.com has 37 tests, and every one of them publishes an answer key: a JSON file listing exactly what a correct scraper should come back with. Run your scraper, diff against the key, and you know.
What’s on it
The tests come in nine groups, from plain HTML to pages that only exist after a script runs:
| Group | Tests | What goes wrong there |
|---|---|---|
| Shop and pagination | 1 | Pages you never reach, products counted twice |
| JavaScript pages | 7 | Infinite scroll, a load-more button, shadow DOM, an iframe, a single-page app |
| Hidden data | 3 | Prices in a JSON script tag, a GraphQL endpoint, an API that wants a token |
| Bad days | 6 | A rate limit, slow pages, pages that fail once, redirect loops, soft 404s, a redesign |
| Forms and logins | 5 | A session cookie, a CSRF token, a search form, three POSTs in a row, postback dropdowns |
| Access | 5 | HTTP auth, a Referer check, a consent wall, soft blocks, file downloads |
| Crawling | 4 | Session IDs and calendars that never end, links that aren’t links, robots hints, sitemaps |
| Messy content | 5 | Lying encodings, four price formats, rowspan tables, invisible characters, microdata |
| Manners | 1 | An area robots.txt disallows |
Twenty-three of them need nothing but HTTP. Ten need a browser, and four need you to keep cookies. Each test page says which, and how hard we think it is, so you can tell a scraper that fails a JavaScript test because it has no browser from one that fails it because it’s broken.
What an answer key says
Here’s part of the shop’s, at /shop/answers.json:
{
"test": "shop",
"data_version": "1.0.0",
"seed": 20261102,
"expect": {
"unique_products": 495,
"listing_pages": 99,
"product_links_on_listing_pages": 998,
"traps": {
"links_with_tracking_parameters": 128,
"links_without_trailing_slash": 76,
"out_of_stock": 56
}
},
"records": [
{
"url": "/shop/p/ardley-fen-brushed-magnet-tiles/",
"name": "Ardley Fen Brushed Magnet Tiles",
"price": 60.99,
"sku": "NW-TOY-4311",
"in_stock": true,
"stock_count": 4
}
]
}
That’s 998 product links for 495 products, which is the whole test in two numbers. Eight products are listed in two categories. A hundred and twenty-eight links carry tracking parameters, and those pages answer 200 with a rel=canonical naming the clean address. Seventy-six links leave off the trailing slash and get a 308 to it. A scraper that follows every link and writes every page gets more than 495 rows, and the key tells you exactly how many more you should have caught.
The real records carry more than this: brand, category, breadcrumbs, images, specs, rating, review count and the crossed-out “was” price where there is one. Every product page also has schema.org JSON-LD, so you can test a structured-data reader against the same key as a CSS one.
Marking our own homework
We pointed Netweir at the shop first, with a spider that takes each product’s JSON-LD, files it under its canonical address, and skips one it already has:
import netweir
class Shop(netweir.Spider):
start_urls = ["https://test.netweir.com/shop/"]
seen = set()
async def parse(self, page):
for href in page.css("main a::attr(href)").getall():
if href.startswith("/shop/p/"):
yield page.follow(href, callback=self.product)
elif href.startswith("/shop/c/"):
yield page.follow(href)
async def product(self, page):
url = page.css("link[rel=canonical]::attr(href)").get()
if url in self.seen:
return
self.seen.add(url)
for thing in page.metadata()["json_ld"]:
if thing.get("@type") == "Product":
yield {"url": url, "name": thing["name"], "price": thing["offers"]["price"]}
And a few lines that check it:
import json
import sys
import urllib.request
KEY = urllib.request.Request(
"https://test.netweir.com/shop/answers.json", headers={"User-Agent": "shop-check/1"}
)
want = {r["url"]: r["price"] for r in json.load(urllib.request.urlopen(KEY))["records"]}
got = [json.loads(line) for line in open(sys.argv[1])]
urls = [r["url"].removeprefix("https://test.netweir.com") for r in got]
print(f"{len(got)} items, {len(set(urls))} unique, {len(want)} in the key")
print("missing:", len(want.keys() - set(urls)), "extra:", len(set(urls) - want.keys()))
print("wrong prices:", sum(float(r["price"]) != want.get(u) for r, u in zip(got, urls)))
$ netweir crawl shop.py -o shop.jsonl
$ python check.py shop.jsonl
495 items, 495 unique, 495 in the key
missing: 0 extra: 0
wrong prices: 0
Right answer. But the crawl log said Netweir 0.7.1 made 739 requests to get it, and the arithmetic didn’t close. The start page, 99 listing pages and 495 products make 595. Of the 144 left over, 93 were tracking-parameter copies, and that’s fair: Netweir strips the utm_ parameters, but a ref=7 might mean something to a site, so it keeps those, and the spider’s canonical check catches them. The other 51 were links without a trailing slash, redirected to a product the crawl had already fetched. Netweir fetched it again anyway.
Scrapy drops those, because its redirects go back through the duplicate filter. Netweir now does too, with one exception: a redirect back to a URL the same request already passed through, the way a login wall sends you round after setting a cookie, is still followed. That’s netweir#235, and it ships in the next release. The same crawl now makes 688 requests.
That was the first test we ran, on our own scraper. It’s what the site is for.
A few of the traps
Some tests are about getting every record. Some are about getting the right one.
- Rate limit. Twenty-one pages that answer
429withRetry-Afteronce you pass twelve requests in ten seconds. The key gives the rule, and says a polite crawler should finish with no 429s at all. - Pages that fail once. Every fourth item answers
503the first time you ask and works the second. One page always fails, and the key expects you to report it rather than invent a record. - Redesign switch. The same 50 products at
/redesign/v1/and/redesign/v2/, with every class renamed, paragraphs swapped for spans and the title moved to another heading. Both layouts put a crossed-out price and a shipping charge beside the real price, so “the first number that looks like money” is wrong in both. - Soft blocks. Twenty item pages, four of which answer 200 with a “verify you are human” page. The right count is sixteen.
- Crawler traps. Twelve articles, a session ID that mints ten new URLs on every page, and a calendar with 119,988 months in it. None of those months is a record.
- Character encodings. Three pages where the bytes, the
Content-Typeheader and the meta tag disagree. You’ll know you’ve got it when the pound signs and curly quotes survive. - Postback dropdowns. Pick a category, then a subcategory, each a POST of the whole form with a signed
__STATEfield you have to send back untouched. If you’ve scraped an old ASP.NET site, you’ve met this one.
The login, CSRF and multi-step tests keep no database. Every session is a signed cookie, so your scraper’s state is the only state there is.
The rules
Bots are welcome. There are no CAPTCHAs, no challenges and no fingerprinting, and nothing on the site tries to tell a person from a program. Every rule a test enforces is published in its answer key, down to how the rate limit counts.
One thing in front of the site isn’t ours. Cloudflare, which hosts it, turns away Python’s built-in urllib and Perl’s libwww-perl when they send their default User-Agent, with a 403 and “error code: 1010”. Send any user agent of your own, as the checker above does, and you’re through. requests, httpx, aiohttp, curl and Scrapy get in as they are.
robots.txt allows everything except /robots-test/, which exists to check that you read it. A polite scraper fetches none of that area.
The data is fixed. A seeded generator makes it, so the shop you scrape today is the one you’ll scrape next month. The data version, 1.0.0 now, is in every key and at the foot of every page, and it changes only when the records do. Everything in it is made up: the products, the brands, the people and the towns.
There’s one limit we don’t publish: a generous rate rule at the edge, there so nobody can knock the site over. The tests never come near it.
If you’re building a harness, tests.json lists every test with its page, its key, its difficulty and what it needs.
What it doesn’t test
It doesn’t test getting past anti-bot systems. The site has none, on purpose, and a scraper that passes everything here can still be blocked by a real shop’s bot protection. It also can’t tell you how a tool does on the sites you actually scrape. What it gives you is a fixed point: the same pages, the same traps and the same right answers every time, so a change in your output is a change in your scraper.
What’s next
Our benchmarks move here. Until now they ran against the practice shop at webscraper.io, which has been a good neighbour, but it never rate-limits and never gets redesigned. The next comparison, in about a week, runs on this site with the wider field: Scrapy, Scrapling, Crawlee, Crawl4AI, Firecrawl, Spider, Playwright, Puppeteer and Colly.
If a test is wrong, or a scraper you care about trips on something that isn’t its fault, or there’s a bad day you’ve lived through that isn’t here yet, tell us in Discussions. We’d rather fix a key than have you trust a wrong one.