```yaml
product: AlterLab
title: "Data Extraction — Web Scraping Glossary | AlterLab"
comparison_context: "AlterLab is an alternative to Firecrawl, ScrapingBee, and Bright Data."
source_url: https://alterlab.io/glossary/data-extraction
```

extraction

# Data Extraction

The process of identifying and pulling specific fields from raw web content, converting unstructured HTML into typed JSON records.

Data extraction is the step after web scraping that transforms raw HTML into usable structured data. While scraping retrieves the page content, extraction identifies and isolates the specific fields needed — product name, price, review count, publication date — and outputs clean, typed records.

Extraction techniques range from CSS selectors and XPath expressions for simple, consistent DOM structures to AI-powered schema extraction for complex or variable layouts. CSS selectors like `div.price > span` and XPath expressions like `//div[@class='price']/span/text()` are precise and fast for stable page structures. For pages where the DOM changes frequently or is semantically complex, AI extraction accepts a JSON schema definition and uses a language model to locate and return the matching fields.

AlterLab supports both approaches. For structured, predictable pages, pass CSS selectors or XPath in the request. For variable layouts, pass an `extract_schema` JSON schema and AlterLab returns the extracted fields directly in the response — no HTML parsing required on your end.

### What is Data Extraction?

The process of identifying and pulling specific fields from raw web content, converting unstructured HTML into typed JSON records.

### How does AlterLab handle Data Extraction?

AlterLab supports both approaches. For structured, predictable pages, pass CSS selectors or XPath in the request. For variable layouts, pass an `extract_schema` JSON schema and AlterLab returns the extracted fields directly in the response — no HTML parsing required on your end.

## Examples

```
# AI-powered schema extraction
{
  "url": "https://example.com/product",
  "extract_schema": {
    "type": "object",
    "properties": {
      "title": { "type": "string" },
      "price": { "type": "number" },
      "rating": { "type": "number" }
    }
  }
}
```

## Related Terms

[Web ScrapingAutomated extraction of data from websites using software tools that parse HTML and collect structured information at scale.](https://alterlab.io/glossary/web-scraping)[CSS SelectorA pattern used to match HTML elements by tag, class, ID, or attribute, used in web scraping to extract specific nodes from parsed HTML.](https://alterlab.io/glossary/css-selector)[XPathXML Path Language — a query syntax for selecting nodes in HTML or XML using path expressions, more expressive than CSS selectors for complex traversals.](https://alterlab.io/glossary/xpath)[Structured Data ExtractionConverting free-form HTML into typed JSON records using explicit schemas, producing clean structured output instead of raw markup.](https://alterlab.io/glossary/structured-data-extraction)[BeautifulSoupA Python library for parsing HTML and XML and navigating the parse tree using CSS selectors or tag methods.](https://alterlab.io/glossary/beautifulsoup)

## Extract Data Extraction data from any website

AlterLab returns clean, structured data from any public URL — no scraper infrastructure needed. Start free, no credit card required.

[View API docs](https://alterlab.io/docs/api/rest)

[Back to Glossary](https://alterlab.io/glossary)