Service Wrapper: a system for converting web data into web services

Naibo Wang, Zhiling Luo, Xiya Lyu, Zitong Yang, Jianwei YinarXiv 2019

Published in late 2019, this research addresses the persistent "data silo" problem of the modern web. While APIs are the backbone of software development, vast amounts of useful information remain trapped behind semi-structured HTML. The authors introduce Service Wrapper, a system that allows non-experts to transform any website—even those with complex search forms and dynamic content—into functional RESTful web services.

The Problem: The "Un-API-ed" Web

Developers needing data from websites without official APIs typically resort to custom web scrapers. However, existing tools often suffer from three major hurdles:

  1. High Expertise Barrier: Many tools require knowledge of specialized extraction languages or complex regular expressions.
  2. Dynamic Content: Data hidden behind search forms (the "Deep Web") is often inaccessible to simple URL-based scrapers.
  3. Maintenance Complexity: Manually identifying "main" content while ignoring ads or sidebars is difficult to automate across diverse layouts.

System Architecture

The Service Wrapper system is divided into two primary components: the Service Extractor (the builder) and the Service Invoker (the runtime).

The Service Wrapper system architecture, illustrating the flow from web page segmentation to the generation of a functional Service API.

1. Service Extractor

This component handles the generation phase through several key innovations:

  • Dynamic Form Processor: It identifies elements with JavaScript click event listeners, allowing interaction with modern, AJAX-heavy search interfaces rather than just standard HTML forms.
  • Block Segmentation Algorithm: Using a DOM-tree-based approach, the system partitions a page into semantic blocks, specifically identifying repeating "sub-blocks" like product list items.
  • Block Sorter: To isolate the most relevant content, the system ranks blocks based on weighted metrics including list count, word count, and physical screen area.
  • Field Meaning Analyzer: It attempts to automatically name output fields (e.g., "Price") by analyzing HTML attributes and querying a Knowledge Graph to predict data types.

2. Service Invoker

Once a service is defined, the Invoker acts as the API gateway. It maps incoming REST parameters to the website's form fields, executes actions in a headless browser environment, and returns the extracted data as a clean JSON object.

Evaluation and Case Studies

The authors demonstrated the system's versatility through live, real-world case studies rather than static benchmarks. Key examples included the China Earthquake Network, where a dynamic search form was successfully converted into a RESTful API, and e-commerce platforms like Amazon and Taobao.

Examples of block segmentation on Amazon and Taobao, showing how the system identifies primary content areas (Block.1) and repeating product sub-blocks.

As shown in the e-commerce examples, the DOM-based segmentation is capable of extracting data even from complex layouts that vision-based segmenters often struggle with. The system effectively treats the website as a live backend, where the wrapper is the API.

Key Insights and Future Work

Service Wrapper proves that a combination of DOM structure analysis and simple heuristics can be highly effective for "fool-style" (user-friendly) operations. By simulating browser interactions, the system bypasses the limitations of traditional crawlers that cannot "see" data behind search buttons.

However, limitations remain. The authors note that field naming is not always perfect and the system still requires a "human-in-the-loop" to initially select the desired data block. Future work may incorporate Natural Language Processing (NLP) to improve the system's contextual understanding of web content.

Summary updated

BibTeX
@misc{wang2019service,
  author = {Naibo Wang and Zhiling Luo and Xiya Lyu and Zitong Yang and Jianwei Yin},
  title = {{Service Wrapper: a system for converting web data into web services}},
  year = {2019},
  eprint = {1910.07786},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1910.07786},
}
Figure