Stable web scraping: an approach based on neighbour zone and path similarity of page elements. (2018) - Gao, Peng; Han, Hao; Guo, Junxia; Saeki, Motoshi
Web scraping techniques based on XPath enable users to consistently extract information of interest from webpages that do not provide a structured interface. However, XPath-based extraction is likely to fail when encountering page variants, resulting in a high cost of repair. Countermeasures based on pattern matching or model learning often require careful pre-processing, which is not suitable for cases where the target data is frequently re-designated. In this paper, we present a new extraction method for the stable scraping of arbitrary designated data from webpages. Instead of attempting to find the desired data directly, we first determine its approximate location in the changed page, called the neighbour zone. Then we search for the precise location by ranking the path similarity of page elements within the neighbour zone. Experiments on a large set of real-world webpages show that our method has better stability for web scraping, compared with the XPath-based extraction. In the two datasets, 0.118 and 0.891 F1-score were increased respectively.