Webpage label text positioning method
A technology of text positioning and webpage labeling, which is applied in the fields of instruments, electronic digital data processing, hardware monitoring, etc., can solve problems such as inconvenient direct access, difficulty, and troublesome process, and achieve easy understanding, small amount of calculation, and less amount of calculation Effect
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0051] A webpage label text positioning method, the operation scene of the method is as follows figure 1 As shown, the scene includes a user and an electronic device, where the electronic device may be a terminal with display shielding such as a desktop computer, a notebook computer, a tablet computer, a mobile phone, and a vehicle-mounted terminal. A user can open a webpage by using a browser of an electronic device, and perform operations on the webpage. figure 2 It is a sample diagram of the browser interface. In a typical web page, elements such as labels, edit boxes, and buttons are included. In general, the label is on the left and right of the edit box, indicating the content to be entered in the edit box. image 3 It is a schematic diagram of a DOM tree, which represents the internal data of a web page. In a typical web page, there are head and body nodes, and the general information of the web page is stored in the head node, such as the title, the size of the web ...
Embodiment 2
[0067]上述实施例一是最简方案,可以达到80%准确率。为了进一步提高准确率,实施例一中的S300可以做一些加强,请参阅图5b,改进后的S300包括:
[0068]S301:在DOM树上定位按钮,获得它在DOM树的位置即在当前节点层级序号N,以及其在页面上的绝对位置(包括x,y,w,h,其中x,y为控件的左上角坐标,w,h分别表示控件的宽和高),执行S302;
[0069]S302:判断当前序号N是否大于零,若大于零则执行S303,否则执行S307;
[0070]S303:获取同一层级序号为N-1的结点,及其绝对位置,执行S304;
[0071]S304:判断该层级序号为N-1的结点是否为包含有效文本信息的对应结点,若该层级序号为N-1的结点为包含有效文本信息的对应结点则执行S305,否则执行S306;
[0072]S305:判断包含有效文本信息的对应结点数量是否达标,若达标则执行S309,否则执行S306;
[0073]S306:基于该层级序号为N-1的结点作为层级序号为N的结点,重新执行S302;
[0074]S307:寻找当前操作控件所在结点的父结点,获取其层级序号N,执行S308;
[0075]S308:判断该父节点是否为根节点,若非根节点则基于该父结点的层级序号N,重新执行S302,若是根节点则执行S309;
[0076]S309:判断控件左边是否存在包含有效文本信息的对应结点,若存在则执行S310,否则执行S311;
[0077]S310:返回重叠面积最大的结点;
[0078]S311:判断控件上边是否存在包含有效文本信息的对应结点,若存在则执行S312,否则执行S313;
[0079]S312:返回重叠面积最大的结点;
[0080]S313:返回空。
[0081]其中,S305中包含有效文本信息的对应结点数量标准最多为五个包含有效文本信息的结点。
Embodiment 3
[0083]本发明实施例还提供了一种网页标签文本定位装置,包括处理器及存储介质;
[0084]所述存储介质用于存储指令;
[0085]所述处理器用于根据所述指令进行操作以执行下述方法的步骤:
[0086]响应于用户操作网页产生网页事件时,向网页DOM树中插入事件监控器;
[0087]响应于用户操作网页控件时,于网页DOM树中定位当前操作控件所在结点;
[0088]基于当前操作控件所在结点查找包含有效文本信息的结点;
[0089]响应于查找到包含有效文本信息的结点后,将结点信息及标签发送至指定位置。
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com