Zenrows
Talk to sales Start free

What is schema-based extraction?

Schema-based extraction inverts how you describe what you want from a page. Instead of writing a selector that says "the text inside the third div with class price-box", you describe the shape of the result: a product has a name, a price as a number, and a currency. The extractor works out where those values live.

Why selectors break

A CSS selector encodes a page's current structure. It is precise, fast and free, and it stops working the moment a designer moves an element or a build tool changes a generated class name. The data is still on the page. Your directions to it have gone stale.

At one site, that is a small maintenance job. Across two hundred sites, it is a permanent one, and the failure is quiet: a selector that no longer matches returns empty rather than raising an error, so the pipeline keeps running and writes nulls until someone notices.

What a schema looks like

A schema names the fields and their types, and usually says which are required:

{
  "title": "string",
  "price": "number",
  "currency": "string",
  "in_stock": "boolean",
  "reviews": [{ "author": "string", "rating": "number" }]
}

The output is the same shape every time, whatever the source page looked like. That is the practical benefit: downstream code can rely on the structure, so scraping a competitor's site and your own does not need two different parsers.

What it costs

Schema-based extraction is not strictly better than selectors, and it is worth being clear about the tradeoff.

Selectors are faster and cheaper per page, and they are exact: if the selector matches, the value is definitionally correct. Schema-based extraction costs more per page and can be wrong in ways a selector cannot, for example picking a crossed-out list price rather than the current one. It is worth paying for when page structures vary or change, and it is overkill for one stable site you control.

A common arrangement is to use selectors where the structure is known and stable, and schema-based extraction for the long tail of sites nobody wants to maintain a parser for.

Where Zenrows fits

Zenrows Extract turns a page into structured JSON in a single request. It builds a tailored extraction for each website rather than applying one generic parser, and keeps that extraction working when the site's layout changes, which is the maintenance cost this approach exists to remove. Where you do want exact selectors, CSS Extractor takes CSS or XPath on the same request and returns JSON, so the two approaches sit behind one API rather than two tools.

Go deeper on the blog

In the docs

Last updated: Aug 16, 2026

Get reliable web data in minutes.

Free plan, 5,000 credits every month, no credit card required.