大多网页都是基于服务器端模板生成的,所以在同一个站点经常看到很多外观相同内容相似的网页。HTML是一种半结构化的标记语言,每个HTML网页都对应一个DOM树结构。网页的相似性表现结构上就是结构相似性。研究网页结构相似性的方法有很多,本文从DOM树中的链路结构的角度来研究不同网页间的相似性,并提出了基于链路压缩树的结构相似度度量模型。本文中的计算方法都用Python语言实现。通过实验,本文使用多种方法对不同网页间的相似度进行了计算和分析,实验数据表明,基于链路压缩树的结构相似度度量模型具有较好的适用性,其速度是传统方法不可比拟的。
Most web pages are generated from templates on servers. As a result, many pages from the same site always look with the same appearance and the similar contents. HTML is a kind of semi-structured mark-up language, and each HTML page has a DOM tree structure. Similarity in structure between web pages is defined as structural similarity, and there are many methods of researching this similarity. From the perspective of D0M path structure, this paper has studied the similarity between two web pages, and proposed a new model of calculating structural similarity based on path pressed trees. All of algorithms in this paper are implemented by Python. We have calculated and analyzed the similarity between different web pages through experiment, which shows that our model of calculating structural similarity is of stronger applicability and the speed is unparalleled in the traditional method.