Urgent.News

What's breaking now, across thousands of outlets.

AI

How Scraping AI Extracts Structured Data from Any Webpage Without CSS Selectors

How Scraping AI Extracts Structured Data from Any Webpage Without CSS Selectors Stop maintaining fragile CSS selectors. Turn any webpage into validated JSON with the Python SDK. [!NOTE] TL;DR The problem: Traditional scrapers break when a site changes its CSS classes, such as .price becoming ._3xP9z . That means more maintenance and broken data pipelines. The solution: The scraping-ai Python SDK…

Traditional web scrapers often rely on CSS selectors to locate data on a webpage. However, when a website's design changes, those selectors can break, leading to data pipeline issues. Scraping AI offers a solution by using semantic extraction instead of fixed selectors.

The Python SDK for Scraping AI works by performing four main steps: smart rendering, markdown distillation, LLM semantic matching, and JSON schema validation. First, the page is rendered, with JavaScript executed for dynamic sites. Next, the raw HTML is converted into a Markdown representation. Then, language models like GPT-4o analyze the content and match it to a provided JSON schema. Finally, the extracted data is validated against the schema before being returned as structured JSON.

Using the SDK is straightforward. After installing it via pip, you can create an instance of the ScrapingAIClient with your API key. Then, you can call the extract method, passing in the URL of the page and a JSON schema defining the data you want to extract. The SDK returns the data in a structured JSON format, making it easy to work with in your application.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in AI

The Same Bug, Four Times, Three of Them Mine

Originally published at ai.bedvibe.studio . Most validation tooling has two states: it passed, or it failed. Everything that was not actually evaluated has to be forced into one of them — and it is…

Dunamu & Partners Invests $5 Million in Kalosm

Kalosm Says Multi-Model Inference Cuts Costs and Speeds Tasks Dunamu & Partners has made a $5 million (about 7.0 billion won) seed investment in UK-based AI inference optimization company…

  • Dunamu & Partners invests $5 million in Kalosm.
  • Kalosm, founded in 2024, combines multiple models for AI inference.
  • Approach reduces costs, improves speed, and boosts success rates.

More from Tuesday 25 August →