You're copying supplier prices into a spreadsheet, and every site makes the job slightly different. One lists a unit price beside the product name, another shows a pack price, and another hides availability behind a variant selector. Automating the copying sounds straightforward until your script returns a perfectly plausible price for the wrong product.
Table of Contents
- What Web Page Information Extraction Means
- Choose an Extraction Technique and Test It
- How to Extract Fields With Selectors, Step by Step
- Using Structured Data Already Embedded in Pages
- Why Extraction Breaks on Real Pages
- Extracting Repeated Records and Measuring Quality
What Web Page Information Extraction Means
Web page information extraction turns a page built for people into records that a program can store, validate, and compare. For a purchasing workflow, that might mean collecting a product name, supplier, price, currency, pack size, and availability while keeping their relationships intact.
Think of a web page as a filing-cabinet drawer filled with mixed notes. Extraction means reading each note and transferring its contents onto a card with fixed, named fields. You're not just photocopying the drawer.
The card layout is your record schema. It defines what each field means, which values are required, and how related items fit together.
From page text to meaningful records
In the supplier example, the product is an entity, its price is an attribute, and the supplier's offer connects that product to a seller. Those distinctions matter because a page can contain the main product, recommended alternatives, and several prices.
Converting HTML to plain text doesn't necessarily preserve those connections. A text dump might retain every product name and every price while losing which price belongs to which item.
Practical rule: A useful extracted value needs both a field name and evidence showing where it came from.
The field emerged in the early 1990s, adapting general information extraction to web documents through manually written rules and methods that learned rules from examples, as described in the web data extraction survey.
That split still explains the central trade-off. Hand-written rules can be precise on stable layouts but demand maintenance; learned systems can handle broader variation but need representative examples and ongoing evaluation. Neither removes the need to check results.
For your supplier spreadsheet, the important question isn't whether a tool can return a price. It's whether that price belongs to the intended product, has the right meaning, and comes back with its source location.
Choose an Extraction Technique and Test It
Extraction techniques by fit, failure point and maintenance effort
| Technique | Best for | Breaks when | Maintenance effort |
|---|---|---|---|
| CSS or XPath selectors | Stable templates with clear class, id, or data attributes | The site renames classes or moves fields | Low per site, rises with site count |
| DOM tree parsing | Fields in consistent element paths | A redesign changes nesting | Low to medium |
| Wrapper induction | Repeated lists on the same site | Structural drift invalidates learned patterns | Medium, rules need regeneration |
| Machine learning extractors | Many sites within a page genre, with labelled examples | The page genre differs from training examples | Medium, needs labels and evaluation |
| LLM extraction | Varied layouts and free-text fields | Navigation, ads, or ambiguous context obscure the target | Low setup, ongoing per-call cost and checks |
| Browser automation | Client-rendered pages, clicks, and authorized logins | Timing changes or interface updates disrupt actions | High, browser runs add latency and moving parts |
Read this comparison through three questions: How many sites must you cover? How often do their layouts change? Does the content appear only after JavaScript runs?
A stable supplier catalog points toward selectors. A collection of news sites with labelled examples points toward a genre-specific learned extractor. Unfamiliar layouts containing descriptive fields may justify an LLM, provided you pass focused content and require a defined output schema.
Separate finding content from interpreting it
CSS selectors identify elements using attributes and relationships, such as a price inside a product container. XPath can also trace relationships between nodes, including a value beside a visible label. Both operate on the DOM, the browser or parser's tree representation of the page.
DOM parsing isn't a completely separate alternative to selectors. A parser builds the tree; selectors query it. You can also traverse that tree directly when the relationship between elements matters more than their class names.
Wrapper induction learns reusable extraction patterns from examples. A machine learning extractor instead learns broader signals, such as what distinguishes article content from surrounding material. With either approach, examples must resemble the pages you'll process.
Browser automation addresses a different problem: obtaining the right page state. A Playwright workflow can select a product variant or wait for results to load before a selector or model extracts the fields. Use authorized access, and don't treat automation as permission to bypass site controls.
Budget for upkeep, not just setup
Selectors look inexpensive when you maintain a single template. Across a growing supplier portfolio, you also inherit template detection, exception handling, and regression tests. LLM extraction reduces some template-writing work, but you still pay for calls and inspect incorrect or unsupported values.
If your team can't maintain acquisition infrastructure, managed extraction is an option. Our page extraction providers at looot include Diffbot, Jina AI, Firecrawl, and Zyte API; we can also search the web and scrape pages to Markdown. Each operation has a reference page on our documentation site with its input fields, an example call, and the response.
Before scaling, build a small, deliberately mixed test set. For example, choose twenty pages across two page types, manually label the expected fields, and compare results separately for each type. Treat that as a starting test design, not proof that the method will handle every future layout.
How to Extract Fields With Selectors, Step by Step
Start with a narrow target: a supplier's product listing, not the entire website. Write down the intended fields before inspecting the page, including whether price means per item, per pack, or the currently selected variant.
Use this visual workflow alongside the detailed checks below.

Build a replayable extraction
Choose a page and a record. Save the HTML before writing extraction logic so you can reproduce failures without depending on the live site. If JavaScript supplies the content, save the rendered DOM as well as the original response.
Find stable anchors. Inspect each field for an id, descriptive data attribute, microdata property, or nearby label because these explain the element's purpose better than a generated class name. Prefer a product-specific anchor over a styling class shared throughout the page.
Write and challenge the selector. Test the initial selector on additional pages using the same template, including a record with missing optional information. For a starter exercise, try five more pages and inspect every match rather than trusting the first successful result.
Select containers before fields. Find each product card, then query its name, price, and availability within that card so an absent field can't shift another product's value into its row. In JavaScript, this means querying each container locally rather than collecting separate global arrays of names and prices.
Normalize without discarding evidence. Remove presentation symbols from numeric values, keep currency in a separate field, and convert unambiguous dates to ISO format so downstream programs can compare them. Retain the raw text beside the normalized value, and flag ambiguous dates instead of guessing.
Validate the record and collection. Check required fields, expected types, and the extracted record count against the intended visible collection because valid-looking individual rows can still conceal missing products. Account explicitly for pagination and lazy loading before deciding that collection is complete.
Store the run context. Save the snapshot reference, selector version, timestamp, and field locations so someone can investigate or replay the result. Record failures explicitly rather than dropping incomplete rows without notice.
Inspect the mistakes a parser won't report
A selector can be syntactically correct and still match a navigation element with the same class. Scope it to the intended content region and inspect whether each match belongs to a record container.
Locale is another trap. Decimal separators, currency symbols, and translated availability labels can change the interpretation of otherwise identical text. Store the locale context and avoid treating an unfamiliar label as a familiar status.
This video provides a companion walkthrough for the extraction process.
Good output has one row per record, a null for a missing optional field, and no populated value without a source location. In filing-cabinet terms, every completed card should still lead you back to the original note.
Using Structured Data Already Embedded in Pages
In a 2009/2010 crawl, approximately 6% of pages contained structured data, compared with 12% in February 2012, according to a study of structured data in Common Crawl. That historical shift illustrates why extraction shouldn't begin by assuming every field must be recovered from visible prose.
Some publishers already describe entities and properties in machine-readable markup. Reading an explicit price property is more direct than deciding whether a nearby number represents a price, discount, or shipping charge. It still requires validation.
Check semantic markup before visual layout
Look for JSON-LD in script elements, microdata and RDFa attributes attached to HTML elements, and OpenGraph meta tags. These formats don't offer identical detail: OpenGraph often describes the page for sharing, while entity markup can describe products, organizations, or job postings.
A practical check order is:
- Identify the entity. Look for a
Product,JobPosting, orOrganizationthat matches the page's subject, rather than accepting the first object you find. - Read relevant properties. A product's
Offercan contain price, currency, and availability; a job posting can include title, location, and publication date. - Validate completeness and meaning. Confirm that the properties required by your schema exist and refer to the intended entity or variant.
- Fill genuine gaps. Use DOM selectors for missing fields, keeping the extraction method attached to each field so discrepancies remain visible.
Say a supplier marks up a product's name and base offer but leaves pack size only in the visible specification table. Combine those sources deliberately. Don't assume the base offer represents the currently selected pack because both appear on the same page.
Choose storage that preserves relationships
Use JSON when records contain nested offers, image lists, or multiple locations. Use CSV when each record is flat and every column has a clear, consistent meaning.
For a database, linked tables can separate products, variants, sellers, and offers, joined through stable keys. That avoids repeating seller details across every product and makes it possible to track an offer independently from the underlying item.
Embedded markup is a publisher's claim about the page, not a guarantee that it matches the visible state.
Before relying on it, compare a sample of markup values with the displayed content. Flag disagreements rather than choosing whichever source was easier to parse.
Why Extraction Breaks on Real Pages
A supplier redesigns its product page and moves the main price into a new container. Your scraper still finds a price, but now it belongs to a related product in the sidebar. The request succeeded, the parser returned a number, and your purchasing comparison is wrong.
This is a dangerous failure because nothing obviously crashed. A missing value would attract attention; a plausible neighboring value can pass unnoticed into a report or an agent's next action.
A clean HTTP response is not evidence of a correct field.
Noise and drift cause different failures
Page noise means unrelated material competes with the target content. Navigation, advertisements, consent dialogs, and sidebars may contain the same words and value patterns as the fields you want.
Structural drift means the relationships your extractor relied on have changed. The page can still describe the same product while its containers, labels, or nesting no longer match the stored extraction logic.
The semi-structured extraction and live-web evaluation findings report language-model triple-extraction performance of up to 77% F1 on cleaned pages versus 28% on whole webpages, and more than 15% average F1 degradation for wrapper-generation methods applied to structurally evolved sites. These are task-specific findings, not predicted accuracy for your supplier scraper, but they demonstrate why both content preparation and live-page testing matter.
Apply safeguards in the right order
- Remove irrelevant regions. Exclude navigation and unrelated recommendations, but preserve the record containers, labels, and tables needed to interpret the target.
- Constrain the output. Define field types, required properties, and allowed status values; a schema checks shape, while separate evidence checks establish correctness.
- Use semantic anchors. Prefer a labelled price within the intended product region over a position-based instruction such as taking the first number.
- Revalidate live pages. Schedule checks against manually verified examples and alert on changed layouts, missing fields, or unexpected record counts.
For client-rendered pages, inspect the state after the required interaction. A displayed price may change when someone selects a size, changes quantity, or chooses a delivery location. Capture those selections with the result.
When visual position matters, preserve a screenshot and enough element information to connect the displayed value to its DOM node. Hidden text, obsolete variant prices, and mobile-only duplicates shouldn't be treated as interchangeable evidence.
Keep the snapshot, parser version, detected layout, validation results, and confidence assessment with each run. If the extractor can't establish which value belongs to the target, return no value and a reason, not the most plausible number nearby.
Extracting Repeated Records and Measuring Quality
Extracting an article means finding a coherent body of prose. Extracting a product list means identifying record boundaries repeatedly while preserving fields that may be missing, repeated, or spread across nested elements.
A listing might contain several images and categories, an optional discount, and a seller badge that appears only on selected items. The multi-record extraction study introduced a 13,120-page Russian news-list dataset with optional and multi-valued attributes, illustrating a more realistic task than filling a fixed title-and-body template.
Compare scores within their actual tasks
Reported extraction scores by page type and method
| Page type or method | Reported F1 | Context |
|---|---|---|
| Article pages, top systems | Approximately 0.93 | The extraction benchmark covering 13 systems reports strong results for article prose, while structured page types range from 0.41 to 0.84; rs-trafilatura achieves 0.859 with average processing time of 44 ms per page |
| Structured page types, across systems | 0.41 to 0.84 | Products, directories, and tables distribute meaningful content across repeated components |
| rs-trafilatura, fast system | 0.859 | A speed-quality reference, not a guarantee for a particular record schema |
| LLM triple extraction, cleaned pages | Higher than whole-page extraction in the cited evaluation | Semi-structured content with boilerplate removed |
| LLM triple extraction, whole webpages | Lower than cleaned-page extraction in the cited evaluation | Unrelated page components interfere with the target signal |
| Wrapper methods, evolved sites versus static snapshots | Degradation rather than an absolute F1 score | Measures resilience to changed layouts, not initial extraction accuracy |
These results aren't interchangeable rankings. Article extraction, triple extraction, and collecting complete business records have different targets and error definitions.
For another perspective, the WebLists study reports 66% overall recall for its best system across 200 structured web data-extraction tasks. A convincing sample record doesn't establish that an extractor found every requested record.
Make quality checks part of each release
Precision asks how much of what you extracted was correct. Recall asks how much of the expected information you recovered. F1 combines them, but it shouldn't replace either measure when diagnosing failures.
Score fields separately: product names can be reliable while availability remains poor. Also separate page genres, so excellent article extraction can't conceal missed records on directories or listings.
For a job-listing project, you could explore roles on JobGlance to help define the role categories your schema needs. Keep discovery categories separate from source evidence: an extracted job title should retain its original wording even if you map it to a standardized role.
Before each release, evaluate a fixed, manually labelled sample for each genre. Include empty results, optional fields, pagination, and changed layouts; report missing records as well as incorrect populated fields.
Deduplicate with stable source identifiers where available, preserving separate observations when the same record appears on multiple pages. Attach field-level confidence based on evidence and validation, not merely a model's self-reported certainty.
Finally, define review rules. Conflicting prices, uncertain record boundaries, and absent required identifiers should trigger abstention or human review. Operational reliability means knowing which cards are trustworthy, which need checking, and which couldn't be filled.
looot offers web search and page extraction through a unified access layer, including providers that return cleaned Markdown or structured page data. Visit looot to choose an operation for your target pages, inspect its documented inputs and response, and test it against your schema before expanding the workflow.



