Introducing Parallel Agents - Run multiple /agent queries simultaneously. Read more →

How do you extract structured data from unstructured HTML?

TL;DR

Extracting structured data from HTML involves parsing the DOM, locating elements, and mapping values to fields. Traditional CSS selectors work but break on site changes. Firecrawl Agent uses AI to find data semantically—define a schema or use natural language prompts.

How do you extract structured data from unstructured HTML?

HTML has tags but no consistent schema across sites. A price might be in <span class="price"> or plain text. Converting to {"price": 29.99} requires identifying and extracting data systematically.

Selector-based extraction is brittle—site redesigns break it. Schema-based AI extraction defines what you want, not where to find it:

result = app.scrape_url("https://example.com/product", {
    "formats": ["extract"],
    "extract": {
        "schema": {
            "type": "object",
            "properties": {
                "productName": {"type": "string"},
                "price": {"type": "number"}
            }
        }
    }
})

The AI understands "price" conceptually, not by CSS class names. Sites change HTML; extraction keeps working.

Key Takeaways

Selector-based extraction requires per-site maintenance. Firecrawl's AI-powered extraction understands content semantically, delivering structured JSON from any page without brittle selectors.

Last updated: Feb 09, 2026
FOOTER
The easiest way to extract
data from the web
. . .. ..+ .:. .. .. .:: +.. ..: :. .:..::. .. .. .--:::. .. ... .:. .. .. .:+=-::.:. . ...-.::. .. ::.... .:--+::..: ......:+....:. :.. .. ....... ::-=:::: ..:-:-...: .--..:: ......... .. . . . ..::-:-.. .-+-:::.. ...::::. .: ...::.:.. . -... ....: . . .--=+-::. :-=-:.... . .:..:: .:---:::::-::.... ..::........::=..... ...:-.. .:-=--+=-:. ..--:..=::.... . .:.. ..:---::::---=:::..:... ..........::::.:::::::-::.-.. ...::--==:. ..-::-+==-:... .-::....... ..--:. ..:=+==.---=-+-:::::::-.. . .....::......:: ::::-::.---=+-:..::-+==++X=-:. ..:-::-=-== ---.. .:.--::.. .:-==::=--X==-----====--::+:::+... ..-....-:..::-::=-=-:-::--===++=-==-----== X+=-:.::-==----+==+XX+=-::.:+--==--::. .:-+X=----+X=-=------===--::-:...:. .... ....::::...:-:-==+++=++==+++XX++==++--+-+==++++=-===+=---:-==+X:XXX+=-:-=-==++=-:. .:-=+=- -=X+X+===+---==--==--:..::...+....+ ..:::---.::.---=+==XXXXXXXX+XX++==++===--+===:+X+====+=--::--=+XXXXXXX+==++==+XX+=: ::::--=+++X++X+XXXX+=----==++.+=--::+::::+. ::.=... .:::-==-------=X+++XXXXXXXXXXX++==++.==-==-:-==+X++==+=-=--=++++X++:X:X+++X+-+X X+=---=-==+=+++XXXXX+XX=+=--=X++XXX==---::-+-::::.:..-..
Backed by
Y Combinator
LinkedinGithubYouTube
SOC II · Type 2
AICPA
SOC 2
X (Twitter)
Discord