Skip to content

Latest commit

 

History

History
42 lines (30 loc) · 1.17 KB

README.md

File metadata and controls

42 lines (30 loc) · 1.17 KB

ui_tree_similarity

Calculate page similarity based on page UI tree structure.

PyV

Reference

Referred to Li Jingyang, Zhang Bo. Method and device for determining the similarity of web page structure

Based on code implementation of HTMLSimilarity.

Method of use

from utils import get_xml_similarity
from adapter import json2xml

is_similarity, value = get_xml_similarity(doc1, doc2)

See main.py for details on how to use it.

Three document types are supported:

  1. json file exported by Droidbot
  2. xml file exported by adb uiautomator
  3. html file

Description

Input parameters:
  • document 1
  • document 2
  • dimension after dimensionality reduction, default is 5000
  • threshold, default is 0.1
  • phrase type, default is 'xml', optionally 'lxml'
Return value:
  • whether or not it is similar
  • similar value (similar for value < tol, not similar for value > tol)