Data Parsing
Data parsing is the step that turns a fetched response into typed records. The fetch stage gives you bytes; parsing decides that this string is a price of 24.99 in EUR, that one is a publication date, and this block is navigation chrome to be thrown away. Four approaches dominate, in rough order of brittleness.
Regular expressions over raw text are the fastest to write and the first to break, because they encode assumptions about whitespace and attribute order that no HTML author promised to keep. Tree-based selection with CSS or XPath, the model behind Beautiful Soup and Nokogiri, is the default for good reason: it survives reformatting and reads like the page structure. Embedded structured data is better still when it exists. Schema.org JSON-LD blocks, Open Graph tags and the JSON payload that a client-rendered page uses to build itself are all already typed, already the publisher's own field names, and far more stable than the markup wrapped around them. Model-based extraction against a schema, offered by Diffbot and by the LLM extraction modes in newer scraping APIs, tolerates redesigns that would break every selector, at the price of per-page inference cost and non-deterministic output that needs validation.
Selector breakage on site redesigns is the dominant ongoing cost of any scraping operation, and it is the reason vendors sell parsed output at a premium over raw HTML. A crawl of 40 targets does not break all at once; it breaks one target at a time, quietly, and the field that vanished still returns a valid-looking empty string. Parsing therefore needs schema validation and per-field null-rate alerting more than the fetch stage needs uptime monitoring. Services like Scrapfly and Diffbot absorb that maintenance into a subscription. Parser leniency compounds it: real-world HTML is malformed and different parsers recover from it differently, producing different trees from the same bytes. The Beautiful Soup documentation gives the canonical example, an empty anchor followed by a stray closing paragraph tag. lxml discards the dangling tag and wraps the anchor in html and body elements, html5lib invents a matching opening paragraph and nests it inside the anchor, and Python's built-in html.parser adds no structure at all. Since the document is invalid, the docs note that none of these is the correct answer, and they recommend naming your parser explicitly so results do not shift between machines.
The decision is arithmetic. Estimate redesign frequency per target against record volume per month. High volume on stable targets favors selectors you maintain. A long tail of targets that each redesign once or twice a year favors buying pre-parsed output, because the cost of a selector engineer scales with target count while the vendor's does not.
Tools that handle data parsing
4 tools in the webscrape.dev directory are commonly used for data parsing workflows, spanning crawling frameworks, web scraping apis, ai extraction. Each is reviewed independently with pricing and editorial assessment.
Beautiful Soup is an open-source Python library for parsing and navigating HTML and XML documents, used to pull structured data out of web pages. Its Pythonic API searches the parse tree with CSS-selector-like find and find_all methods, handles charset and Unicode conversion automatically, and lets you swap parser backends between Python's built-in html.parser, lxml, and html5lib. It only parses documents: it doesn't fetch pages or render JavaScript, so it's usually paired with requests or Scrapy.
Nokogiri is an open-source, MIT-licensed Ruby library for parsing, searching, and manipulating XML and HTML documents. It ships with DOM, SAX, and Push parsers for XML, HTML4, and HTML5, supports document querying through XPath 1.0 and CSS3 selectors, and handles XSD schema validation, XSLT transformation, and a builder DSL for generating markup. It requires Ruby 3.2+ or JRuby 10.0+, and since it only parses static markup, JavaScript-rendered pages need a separate HTTP client or headless browser in front of it.
Scrapfly is an API-first web scraping and browser automation platform built around a single endpoint that handles anti-bot bypass (including Cloudflare, Akamai, DataDome, and PerimeterX), JavaScript rendering, and rotating residential and datacenter proxies across 190+ countries. It returns HTML, Markdown, plain text, JSON, or screenshots. The product line extends beyond the core scraping API to a Cloud Browser, an LLM-powered Extraction API, a Crawler API, an AI Browser Agent, and an MCP server for Claude, Cursor, and Cline. Scrapfly was founded in 2017 for internal use and opened to the public in 2020. It is operated by Joam Intelligence, LLC, a bootstrapped company, and ships SDKs for Python, TypeScript, Go, Rust, and Scrapy.
Diffbot is a web data extraction company that uses computer vision and machine learning to pull structured data from web pages without hand-written scraping rules. Its product line includes Extract, for pulling article, product and discussion fields; Crawl, for site-wide crawling into structured databases; and a Natural Language API for entity, relationship and sentiment extraction. It also maintains a Knowledge Graph built from continuous web crawling, covering more than 246 million organizations, 1.6 billion news articles and 3 million retail products.