Skip to main content

How to Extract Structured Data From Websites With an LLM (2026)

By Steven Van ·

Browser Use's guide covers schema design, validation and retries, and compares Firecrawl, Crawl4AI, Browser Use and Stagehand for extracting JSON.

Browser Use has published a guide to pulling structured JSON from websites with an LLM, comparing four tools: Firecrawl, Crawl4AI, Browser Use and Stagehand. The company notes that it makes Browser Use, and says its facts about the other tools come from their own docs and pricing pages, checked October 26, 2026.

The recommended workflow

Write one JSON Schema for the record and reuse it on every site. For static pages, fetch clean page text as Markdown and have the LLM fill the schema. Use a browser agent only for pages that need a login, clicks or a JavaScript flow. Validate every record against the schema, retry or flag failures, and store the source URL with each record.

Reliability checklist

  • Schema: required fields with types, and enums where values are fixed. It can be written in JSON Schema or generated from a Pydantic or Zod model.
  • Constrained output: turn on the model's structured outputs.
  • Validation in code: parse every record with Pydantic or Zod, since valid JSON is not the same as correct data.
  • Null, not a guess: make missing fields nullable but still required, and tell the model to return null when the page doesn't show the value.
  • Evidence: keep source_url on every record, plus a short quote for fields you'll act on.
  • Dedupe: use a stable key such as the canonical URL or SKU.
  • Polite crawling: rate-limit per domain, and follow robots.txt and the site's terms.
  • Spot-checks: compare a random sample with the live pages before trusting a run, and again after a site changes.
  • Saved code: for repeated jobs, keep the working extraction script instead of prompting from scratch.

Which tool fits

  • Known URLs and static pages: fetch + Markdown + LLM, or Firecrawl JSON mode. A browser agent adds model steps and browser time that aren't needed here.
  • Self-hosted, any model, Python: Crawl4AI.
  • Code-first browser automation with AI steps, in TypeScript, Python or Go: Stagehand.
  • Logins, filters, pagination and multi-step forms: a browser agent such as Browser Use, or Firecrawl's Interact.

The guide also gives a comparison table covering schema support, licensing and pricing. For Browser Use, it lists pay-as-you-go pricing with no subscription: model tokens, browser at $0.02/hour and proxy at $5/GB. The agent library is MIT licensed, and Cloud is hosted.

Browser Use example

The Cloud API takes the schema as output_schema. Browser Use checks the agent's final answer against it. If it can't match, the run fails with "Could not produce output matching outputSchema" instead of returning non-conforming output. The example uses a Pydantic model, runs a task across every results page of a shop, and validates run.output again in code.

Limits: API runs only, JSON Schema 2020-12 by default, up to 64 KiB, 64 nesting levels and about 4,000 values. For repeated jobs, the first run can save a tested script in a workspace. Later runs pass workspace_id, fetch fresh data from the live site and repair the script if the site changed. Each run still uses model tokens.

The full write-up is in the original post, and the Browser Use page has more on the product.

Browser Use
Browser Use
Open-source browser automation platform for AI agents — let LLMs drive a real browser to research, fill forms, scrape, and complete multi-step tasks.
View Browser Use →

Original source

Read How to Extract Structured Data From Websites With an LLM (2026) on Creators Toolbox