Abstract
Web automation holds the potential to revolutionize how users interact with the digital world, offering unparalleled assistance and simplifying tasks via sophisticated computational methods. Central to this evolution is the web element nomination task, which entails identifying unique elements on webpages. Unfortunately, the development of algorithmic designs for web automation is hampered by the scarcity of comprehensive and realistic datasets that reflect the complexity faced by real-world applications on the Web. To address this, we introduce the Klarna Product Page Dataset, a comprehensive and diverse collection of webpages that surpasses existing datasets in richness and variety. The dataset features 51,701 manually labeled product pages from 8,175 e-commerce websites across eight geographic regions, accompanied by a dataset of rendered page screenshots. To initiate research on the Klarna Product Page Dataset, we empirically benchmark a range of Graph Neural Networks (GNNs) on the web element nomination task. We make three important contributions. First, we found that a simple Convolutional GNN (GCN) outperforms complex state-of-the-art nomination methods, and further enhance its performance using a Reversible GNN (RevGNN) architecture. Second, we introduce a training refinement procedure that involves identifying a small number of relevant elements from each page using the aforementioned GNN. These elements are then passed to a Large Language Model for the final nomination. This procedure significantly improves the nomination accuracy by 10.9 percentage points on our challenging dataset, without any need for fine-tuning. Finally, in response to another prevalent challenge in this field – the abundance of training methodologies suitable for element nomination – we introduce the Challenge Nomination Training Procedure, a training method that further boosts nomination accuracy.
Introduction
Web automation—the ability for an AI to navigate sites, fill forms, or extract data—relies on web element nomination. This is the task of identifying a specific, unique element on a page, such as a "Buy Button" or "Product Price." Real-world websites are notoriously messy, featuring thousands of nested Document Object Model (DOM) elements and vastly different layouts. Furthermore, existing research has been limited by data scarcity, with most datasets being too small, relying on simulated environments, or restricted to English-only sites. This research addresses these gaps by introducing a massive, diverse dataset and a novel hybrid modeling approach.
The Klarna Product Page Dataset
The core contribution of this work is the Klarna Product Page Dataset, the largest and most diverse collection of its kind. It comprises 51,701 product pages from 8,175 distinct merchants across eight geographic regions (DE, US, GB, FI, AT, SE, NO, NL).
Each page in the dataset includes five manual labels (buy button, cart button, product price, product name, and product image) and is accompanied by rendered screenshots. This diversity ensures that models trained on this data can generalize across the millions of unique e-commerce sites found globally, regardless of language or local design conventions.
Methodology
The researchers treat the webpage as a graph (the DOM tree) and evaluate several approaches to identify target elements:
- GNN Benchmarking: They tested three families of Graph Neural Networks: Recurrent (Tree-LSTMs), Convolutional (GCNs), and Attention-based (Transformers).
- RevGNN: To handle the depth of DOM trees, they utilized a Reversible GNN architecture, allowing them to scale up to 20 layers for better feature extraction without hitting memory bottlenecks.
- Post-Training LLM Refinement: Recognizing that LLMs are too computationally expensive to process an entire webpage's HTML, the authors proposed a two-step pipeline. First, a GNN identifies the top 10 most likely candidates for a class. Then, GPT-4 examines the local HTML of only those 10 candidates to make the final "nomination."
- Challenge Nomination Training Procedure (CNTP): Standard training often treats random unlabeled nodes as "negatives." CNTP instead identifies "hard negatives"—unlabeled elements the model is currently confused by—and adds them to the training set to force the model to learn finer distinctions.
Key Results and Insights
Simplicity and Structure
Surprisingly, a simple 2-layer GCN-Mean outperformed complex, state-of-the-art methods like FreeDOM and DOM-Q-NET. This suggests that for web elements, the most relevant context is often concentrated in the immediate local neighborhood. However, the 20-layer RevGNN achieved the highest baseline accuracy overall, averaging 74% across all tasks.
The Hybrid Advantage
LLMs are excellent at reasoning about local HTML snippets but struggle with global page structure due to context window limits. Using GNNs as a "structural filter" for LLMs plays to the strengths of both architectures. Adding the GPT-4 refinement step increased nomination accuracy by 10.9 percentage points on average, with the most significant gains seen in identifying product images.
Training Refinements
The novel Challenge Nomination Training Procedure (CNTP) improved the GCN-Mean model's accuracy by approximately 5 percentage points, proving that training on "hard" examples is crucial for the nomination task. Additionally, the models remained competitive even without text features, suggesting they can be deployed across different languages using only structural and style features like bounding boxes and CSS tags.
Conclusion
This work demonstrates that while GNNs are powerful tools for navigating the structural complexity of the web, their performance can be significantly augmented by the reasoning capabilities of LLMs. By providing the Klarna Product Page Dataset, the authors offer a robust foundation for future research in web automation, encouraging the development of models that can handle the messy, multilingual reality of the modern internet.
Summary updated