Structured vs Unstructured Web Data
What Is Structured Data
Structured data follows a predefined schema where every record has the same fields in the same order with consistent data types. A relational database table is the clearest example: each row has the same columns, each column has a defined type (integer, string, date), and the relationships between tables are explicitly defined through foreign keys. When you query a structured data source, you know exactly what fields will come back and what format they will be in.
On the web, structured data appears in several forms. JSON and XML API responses are structured because they follow a consistent schema defined by the API provider. CSV and Excel files are structured because they organize data into rows and columns. HTML tables are semi-structured because they have a consistent row-and-column layout but the cell contents may contain free-form text, links, or embedded elements. Schema.org markup embedded in web pages (the JSON-LD blocks that search engines read) is explicitly structured metadata describing the page content.
The key characteristic of structured data is predictability. A field called "price" will always contain a numeric value. A field called "date" will always contain a date string in a known format. An "email" field will always contain an email address. This predictability makes extraction straightforward: you map source fields to destination fields, apply any necessary type conversions, and the data flows through the pipeline reliably.
Common structured data sources on the web include REST and GraphQL APIs, RSS and Atom feeds, sitemap XML files, product data feeds (like Google Merchant Center feeds), financial data APIs (stock prices, exchange rates), government open data portals (data.gov, eurostat), and machine-readable datasets published in CSV or JSON format.
What Is Unstructured Data
Unstructured data is information that does not conform to a predefined data model. It has no consistent fields, no fixed schema, and no guaranteed format. The majority of data on the web is unstructured: blog posts, news articles, forum discussions, product reviews, social media updates, PDF reports, images, videos, and audio recordings.
An article on a news website is unstructured in the data extraction sense because the information you might want to extract (people mentioned, companies discussed, events described, statistics cited) is embedded in natural language text rather than sitting in labeled fields. Two articles about the same topic might describe it in completely different ways, use different terminology, and organize the information differently. There is no schema that guarantees where the relevant data will appear.
Web pages themselves are an interesting hybrid. The HTML markup provides some structure (headings, paragraphs, lists, links), but the content within those structural elements is free-form text. A product page on an e-commerce site has structured elements (price in a specific tag, title in an h1, rating in a data attribute) surrounded by unstructured descriptions, reviews, and marketing copy. This mix of structured and unstructured content on the same page is the norm on the web.
Other common unstructured sources include email bodies, scanned documents and images, chat logs and messaging threads, audio transcripts, handwritten notes, and video content. Each of these requires different extraction approaches, from OCR for images to NLP for text to speech recognition for audio.
Semi-Structured Data
Between fully structured and fully unstructured sits a large category of semi-structured data. This is information that has some organizational properties but does not conform to a rigid schema.
HTML web pages are the most common semi-structured data source. The page has structural elements (divs with class names, heading hierarchies, lists, links) that provide clues about what the content represents, but the specific structure varies from site to site and even from page to page within the same site. A product listing page on one e-commerce site might put the price in a <span class="price"> element, while another site uses a <div data-price="29.99"> attribute. The data is not randomly arranged (there are patterns), but the patterns are not standardized.
JSON documents without a fixed schema are another common semi-structured format. A collection of user profiles might include different fields for different users: some have a phone number, some do not; some list hobbies, others list job history. The data is organized as key-value pairs, but the set of keys varies between records. NoSQL databases like MongoDB store this kind of flexible, semi-structured data natively.
Email is semi-structured as well. The headers (From, To, Date, Subject) are structured and machine-readable, while the body is free-form text. Log files follow a similar pattern: each line has a predictable structure (timestamp, severity level, source) but the message content is unstructured text.
How Data Structure Affects Extraction
The structure of your data source determines which extraction tools and techniques you need, how reliable the extraction will be, and how much development and maintenance effort the pipeline requires.
Extracting structured data is largely a plumbing exercise. You connect to the data source (API, database, file), map source fields to destination fields, handle pagination or batching, and load the results into your target system. The tools for this are well-established: API client libraries, database connectors, ETL platforms like Fivetran or Airbyte, and file parsers for CSV and XML. Extraction reliability is high because the schema is known, and maintenance burden is low because schema changes are typically documented by the data provider.
Extracting from semi-structured HTML requires writing selectors or parsing rules that target specific elements on the page. This is the domain of web scraping, where you use CSS selectors, XPath expressions, or DOM traversal to locate and extract data from page elements. Extraction reliability depends on how stable the target page's markup is: a minor CSS class change can break your selectors. Maintenance burden is moderate to high because web pages change their layouts regularly and without notice.
Extracting from unstructured content requires the most sophisticated techniques. Natural language processing identifies entities, relationships, and facts within text. OCR converts images to text. Machine learning classifiers categorize content. AI document extraction platforms combine vision models with language understanding to parse complex document layouts. Extraction reliability varies widely depending on the quality of the source material and the sophistication of the extraction model. Maintenance burden can be low for AI-powered approaches (models generalize across layout changes) but high for rule-based approaches.
Choosing Your Approach Based on Data Type
For structured sources, use the native access method. If the data comes from an API, use the API. If it comes from a database, use a database connector. If it comes from a CSV or JSON file, parse it directly. Do not overcomplicate structured extraction with scraping or AI tools when simpler approaches work perfectly.
For semi-structured HTML, start with web scraping. Try pandas.read_html() for tables, BeautifulSoup for general HTML parsing, and Playwright for JavaScript-rendered content. If the target site changes its layout frequently or you need to extract from many different sites without writing custom selectors for each one, consider AI-powered extraction tools that use visual or semantic understanding instead of brittle CSS selectors.
For unstructured documents, evaluate whether a template-based approach works (it does when documents follow a consistent layout) or whether you need AI/ML-based extraction (necessary when layouts vary). For text extraction from narrative content, LLM-based approaches are increasingly practical: you can prompt a large language model to extract specific fields from a block of text without any custom training.
For mixed sources, build a pipeline that routes each source to the appropriate extraction method. Use an API connector for structured feeds, a scraper for semi-structured web pages, and a document AI service for unstructured PDFs. The integration layer normalizes the output from all sources into a consistent schema before loading it into the target system.
The structure of your data source determines your extraction method. Use API clients and file parsers for structured data, web scrapers for semi-structured HTML, and AI-powered platforms for unstructured documents. Match your tool complexity to your source complexity, and avoid using sophisticated tools when simple ones will do the job.