Web data extraction based on partial tree alignment

Yanhong Zhai, Bing LiuWWW 2005

Introduction

In the modern digital landscape, the World Wide Web serves as a massive repository of structured information. However, this data is often embedded within complex HTML layouts designed for human consumption rather than machine readability. Researchers Yanhong Zhai and Bing Liu address this challenge with DEPTA (Data Extraction based on Partial Tree Alignment), a framework designed to automatically transform semi-structured web pages into clean, tabular database formats.

The Challenge of Web Data Extraction

Extracting data from the web typically involves overcoming the limitations of "wrappers"—software components that map web data to a structured format. Traditional methods like wrapper induction require extensive manual labeling, which is both time-consuming and fragile; if a website's layout changes, the wrapper often breaks. Automatic pattern discovery methods, while more scalable, frequently struggle with the "noisy" nature of real-world HTML, such as missing tags or optional data fields that appear inconsistently across records.

A typical web page containing multiple semi-structured data records for books.

As shown in the figure above, data records (like book listings) are visually distinct to humans but can be difficult for machines to segment accurately when the underlying code is inconsistent or malformed.

The DEPTA Methodology

DEPTA introduces a two-step process to achieve high-accuracy extraction without human intervention.

Step 1: Enhanced Data Record Extraction (MDR-2)

Unlike previous systems that rely solely on raw HTML source code, DEPTA utilizes the browser's rendering engine to obtain the visual coordinates of every element. By analyzing the physical "gaps" between items, the system can more accurately segment a page into individual records. For instance, the white space between two different product listings is typically larger than the space between a product's title and its price. This visual-first approach allows for the construction of a "tag tree" that is significantly more robust than one derived from potentially malformed HTML tags.

Step 2: Partial Tree Alignment

Once records are identified, they must be aligned so that corresponding data fields (e.g., all "Prices") are grouped into the same database column. DEPTA employs a novel Partial Tree Alignment algorithm.

Hierarchical tag tree structure used for aligning data records.

The algorithm begins by selecting a "seed tree"—the record containing the most data fields. It then iteratively matches other records against this seed. Unlike standard tree matching, which requires a total fit, partial alignment only matches nodes with high certainty. If a record contains a field not present in the seed, the system expands the seed tree to include this new optional field. This allows the system to reverse-engineer the site's underlying template dynamically.

Key Results and Evaluation

The authors evaluated DEPTA using 72 web pages from 49 diverse websites, including major platforms like Amazon and eBay. The results demonstrated exceptional performance:

  • Record Identification: Achieved 98.27% Recall and 99.82% Precision.
  • Data Item Extraction: Achieved 98.18% Recall and 99.68% Precision.

These metrics represent a significant improvement over previous state-of-the-art methods, particularly in handling optional fields and non-contiguous data.

Limitations and Future Directions

Despite its success, DEPTA has specific constraints. It requires at least two records on a page to identify a pattern, meaning it cannot extract data from single-record pages. Additionally, while the framework is theoretically capable of handling nested records (records within records), the current implementation focuses primarily on flat lists and tables. Future work aims to refine these capabilities and further automate the labeling of extracted data columns.

Summary updated

BibTeX
@inproceedings{zhai2005web,
  author = {Yanhong Zhai and Bing Liu},
  title = {{Web data extraction based on partial tree alignment}},
  booktitle = {The Web Conference},
  year = {2005},
  doi = {10.1145/1060745.1060761},
}
Figure