TL;DR
Finding specific data files across massive websites is notoriously slow and resource-heavy. This paper proves that finding an optimal crawl path is computationally intractable (NP-complete) and introduces SB-CLASSIFIER, a focused crawler that uses reinforcement learning to discover targets efficiently. By learning from the structural HTML "tag paths" of hyperlinks, it can retrieve up to 90% of a website's target datasets while downloading as little as 20% of its pages.
What Problem Does This Paper Address?
Data journalists, fact-checkers, and social scientists heavily rely on open statistical datasets (SDs) published by governments and international organizations (like the World Bank or the UN). However, these datasets are scattered across millions of web pages, often without clean APIs or comprehensive search engine indexing.
Standard search engines truncate results or miss non-standard file extensions entirely. On the other hand, an exhaustive website crawl (like Breadth-First Search) is incredibly inefficient and slow due to "crawling ethics"—the requirement to wait around one second between requests to avoid overloading servers. For a site with a million pages, this wait time alone takes 11 days.
The authors formalize this challenge as a graph crawling problem, where the goal is to find a subtree containing all target nodes at minimal cost. They prove that even if the entire website layout were known in advance, finding the optimal path is NP-complete. Thus, we need smart, lightweight heuristics that can navigate unknown web graphs on a single machine.
Methods
The authors propose SB-CLASSIFIER, a focused crawler driven by Reinforcement Learning (RL). It treats crawling as a single-state Multi-Armed Bandit problem, specifically utilizing the Sleeping Bandits framework because the available choices (links to crawl) disappear once visited ("go to sleep").
The core components include:
- Structural Learning via Tag Paths: Instead of analyzing page text—which is language-dependent and computationally heavy—the crawler groups hyperlinks based on their tag path. This is the exact sequence of HTML tags from the root of the document to the anchor tag (e.g.,
html > body > div#main > ul > li > a). The underlying hypothesis is that links nested within similar structural components lead to similar types of content.
- Vectorization and Clustering: Tag paths are converted into $n$-grams, hashed into a fixed-dimensional vector, and clustered online using a Hierarchical Navigable Small World (HNSW) index to dynamically form "actions" for the bandit algorithm.
- Online URL Classifier: To avoid making expensive HTTP HEAD requests just to check a link's file type (MIME type), the authors integrate a lightweight online logistic regression classifier trained on character 2-grams of the URLs. This predicts whether a link points to an HTML page or a target dataset file.
Datasets
The approach was evaluated on 18 diverse, real-world websites spanning French government portals (e.g., National Assembly, Ministry of Justice) and international organizations (e.g., World Bank, UN, OECD, US Census).
In total, the evaluation corpus comprised 22.2 million distinct web pages. As shown in the paper's website characteristics table, these sites varied wildly in size (from a few thousand to over a million pages), target density (from 1.5% to 66%), language (over 20 languages represented), and structural depth.
Key Insights and Ideas
- Structure Trumps Semantics: One of the biggest "aha" moments is that the structural location of a link (its DOM tag path) is an incredibly strong, language-independent predictor of what kind of file lies on the other side. The crawler doesn't need to understand what the text says; it just learns where the data tends to be buried.
- The Power Law of Web Rewards: Rewards (the number of datasets found per path) are not normally distributed; they closely resemble a power law. A few structural paths yield massive troves of data, while most yield nothing.
- Language Independence: Because it relies on HTML tags and raw URL strings rather than natural language processing, the exact same algorithm works seamlessly across English, French, Japanese, Arabic, and multilingual sites without any manual tuning.
Key Results
SB-CLASSIFIER consistently outperformed standard baselines (BFS, DFS, Random) and existing state-of-the-art focused crawlers (like TRES and TP-OFF).
- Efficiency Gains: On massive websites like the US Census or the World Bank,
SB-CLASSIFIERretrieved 90% of all target datasets while crawling only ~20% of the pages. - Resource Savings: On a medium-sized site,
SB-CLASSIFIERcollected 10,000 targets in under 11 hours, whereas a standard BFS crawl took over 48 hours (a 4.5x speedup). On larger sites, baselines would literally take months of continuous crawling to match whatSB-CLASSIFIERfound in days.
Limitations and Future Work
- Static vs. Dynamic Content: The crawler is designed for a "single-shot" discovery phase. It does not currently handle incremental crawling to detect when datasets are updated or newly published.
- Deep Web Barriers: It relies on standard hyperlink navigation and cannot currently bypass forms, login screens, or complex interactive data portals that require user input.
- Simple Reward Function: The current reward model treats all target files equally (1 dataset = 1 reward). The authors note that future work will explore more complex reward functions that prioritize data quality, uniqueness, or specific sub-topics.
Summary updated