CN113626028A - Page element mapping method and device - Google Patents

Page element mapping method and device Download PDF

Info

Publication number
CN113626028A
CN113626028A CN202010378558.9A CN202010378558A CN113626028A CN 113626028 A CN113626028 A CN 113626028A CN 202010378558 A CN202010378558 A CN 202010378558A CN 113626028 A CN113626028 A CN 113626028A
Authority
CN
China
Prior art keywords
page
target
path
buried point
node
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010378558.9A
Other languages
Chinese (zh)
Inventor
罗嘉辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202010378558.9A priority Critical patent/CN113626028A/en
Publication of CN113626028A publication Critical patent/CN113626028A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • G06F16/986Document structures and storage, e.g. HTML extensions

Abstract

The embodiment of the application provides a mapping method and a mapping device of page elements, which relate to the technical field of information, and the method comprises the following steps: the method comprises the steps of comparing current data and reference data of a target page, determining a target element which changes in the target page, and then determining a mapping node which corresponds to the target element from each node of a second DOM tree based on a first path of the target element in a first DOM tree which corresponds to the reference data and a path of each node in the second DOM tree which corresponds to the current data, so that when the structure of the target page changes, the configuration of the target element can be directly modified based on a second path of the mapping node in the second DOM tree, and then the changed target element is monitored or tested without related personnel paying attention to the change of the page in real time, and the path of the target element is obtained again for configuration when the page changes, so that the stability and the continuity of page monitoring are improved, and the time and labor cost are reduced.

Description

Page element mapping method and device
Technical Field
The embodiment of the application relates to the technical field of information, in particular to a mapping method and device of page elements.
Background
With the deep development of the mobile internet, the functions are continuously enriched, the product is iterated at a high speed, and the updating requirements of page elements such as modification, increase and deletion are more and more.
When the page structure changes, the path corresponding to the page element also changes correspondingly, so that the monitoring of some page monitoring platforms on the page element based on the path is influenced. For example, in a buried point system, when a page of a buried point changes, the buried point configured in the page will fail, thereby causing data collection failure.
Disclosure of Invention
The embodiment of the application provides a page element mapping method and device, which are used for determining a mapping node of a page element in a changed target page when a page structure is changed.
In one aspect, an embodiment of the present application provides a method for mapping a page element, where the method includes:
acquiring current data and reference data of a target page, wherein the reference data is acquired according to a reference page of the target page;
determining a target element which can cause corresponding change of the current data in each page element of the reference data and a first path of the target element in a first Document Object Model (DOM) tree corresponding to the reference data;
and determining a mapping node corresponding to the target element from each node of the second DOM tree according to the path of each node in the second DOM tree corresponding to the current data and the first path.
In one aspect, an embodiment of the present application provides an apparatus for mapping a page element, where the apparatus includes:
the acquisition module is used for acquiring current data and reference data of a target page, wherein the reference data is acquired according to a reference page of the target page;
the comparison module is used for determining a target element which can cause the current data to be correspondingly changed in each page element of the reference data and a first path of the target element in a first Document Object Model (DOM) tree corresponding to the reference data;
and the mapping module is used for determining a mapping node corresponding to the target element from each node of the second DOM tree according to the path of each node in the second DOM tree corresponding to the current data and the first path.
In one aspect, an embodiment of the present application provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the mapping method for page elements when executing the program.
In one aspect, embodiments of the present application provide a computer-readable storage medium, which stores a computer program executable by a computer device, and when the program runs on the computer device, the computer device is caused to execute the steps of the mapping method for page elements.
In the embodiment of the application, the changed target elements in the target page are determined by comparing the current data of the target page with the reference data, then the mapping nodes corresponding to the target elements are determined from all nodes of the second DOM tree based on the first paths of the target elements and the paths of all nodes in the second DOM tree corresponding to the current data, so that when the structure of the target page is changed, the configuration of the target elements can be directly modified based on the second paths of the mapping nodes in the second DOM tree, then the changed target elements are monitored or tested without related personnel paying attention to the change of the page in real time, and the paths of the target elements are obtained again for configuration when the page is changed, so that the stability and the continuity of page monitoring are improved, and the time and the labor cost are reduced.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
FIG. 1 is a diagram of a system architecture to which embodiments of the present application are applicable;
fig. 2 is a schematic diagram of a registration interface provided in an embodiment of the present application;
fig. 3 is a schematic diagram of a buried point operation interface according to an embodiment of the present disclosure;
fig. 4 is a schematic flowchart of a mapping method for a page element according to an embodiment of the present application;
FIG. 5 is a schematic structural diagram of a DOM tree provided in the embodiments of the present application;
fig. 6 is a schematic diagram of a system architecture of a web crawler according to an embodiment of the present application;
FIG. 7 is a schematic diagram of a crawler task configuration interface provided in an embodiment of the present application;
fig. 8 is a schematic flowchart of determining a mapping node corresponding to a target element according to an embodiment of the present disclosure;
FIG. 9 is a structural diagram of a DOM tree according to an embodiment of the present application;
FIG. 10 is a diagram illustrating a structure of a DOM tree according to an embodiment of the present application;
fig. 11 is a schematic flowchart of a method for acquiring embedded point configuration information according to an embodiment of the present disclosure;
fig. 12 is a schematic flowchart of a method for deploying a buried point according to an embodiment of the present application;
fig. 13 is a schematic flowchart of a method for updating a buried point according to an embodiment of the present disclosure;
fig. 14 is a schematic flow chart illustrating a method for deploying a buried point according to an embodiment of the present disclosure;
fig. 15 is a schematic flowchart of a method for updating a buried point according to an embodiment of the present disclosure;
fig. 16 is a schematic flowchart of a page testing method according to an embodiment of the present application;
fig. 17 is a schematic structural diagram of an apparatus for mapping page elements according to an embodiment of the present application;
fig. 18 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more clearly apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
For convenience of understanding, terms referred to in the embodiments of the present invention are explained below.
Embedding points: monitoring events in the running process of the software application, and judging and capturing when the events needing attention occur.
Elements: an HTML element is understood to be a basic unit of an HTML document, which is an element constituting a web page, also called a node, for example Hyper Text Markup Language (HTML). The HTML file may arrange HTML elements in a tree structure. Further, an HTML element is an element that satisfies one or more Document Type Definition (DTD) requirements. The HTML elements may have attributes and content and may be titles, paragraphs, links, lists, embedded media or any other format that meets the DTD requirements.
Label (tag): refers to the identification of individual elements in a web page, and may also be referred to as web page tags. Further, in HTML (hypertext markup language), the tags may include a Title Tag (Title Tag), a Description Tag (Description Tag), a keyword Tag (Keywords Tag), and the like, and further, the tags may include p, div, i, img, h1, span, and the like, and these tags correspond to web page elements, that is, each element (including sub-elements) may have a corresponding Tag.
Document Object Model (DOM): the DOM tree comprises elements and a hierarchical structure among the elements, and can be sequentially divided into a first layer, a second layer, a third layer and the like from top to bottom.
Root node: refers to the starting element in the corresponding tree structure of the page, such as the first element in the DOM tree.
Web crawlers: a program or script automatically captures web information according to certain rules.
The following is a description of the design concept of the embodiments of the present application.
The visual embedded point technology is that a visual interaction means is used for setting embedded points in a page needing data collection, and when the page is opened or a user clicks a certain control in the page, the embedded points are called to complete data collection. And a visual page interaction means is used for replacing code writing, so that the workload and the communication cost are greatly reduced, and meanwhile, the error probability is reduced. However, when the page structure changes, the buried points configured in the page will fail, resulting in data collection failure.
Considering that when the page structure changes, the DOM tree corresponding to the page also changes, and the path corresponding to the target element in the original page in the DOM tree also changes correspondingly. Because the embedded point configuration information corresponding to the target element includes the path of the target element, when the page structure changes, the mapping node corresponding to the target element in the changed page needs to be determined, then the path in the embedded point configuration information corresponding to the target element is modified into the path of the mapping node, otherwise, the embedded point function cannot be realized based on the original embedded point configuration information of the target element, so that the embedded point of the target element is invalid, and further, the data acquisition fails. In view of this, an embodiment of the present application provides a page element mapping method, which first obtains current data and reference data of a target page, where the reference data is obtained according to a reference page of the target page. Then, a target element which can cause corresponding change of the current data in each page element of the reference data is determined, and a first path of the target element in a first DOM tree corresponding to the reference data is determined. And then determining mapping nodes corresponding to the target elements from all nodes of the second DOM tree according to the path of each node in the second DOM tree corresponding to the current data and the first path.
The method comprises the steps of determining a changed target element in a target page by comparing current data of the target page with reference data, determining a mapping node corresponding to the target element from each node of a second DOM tree based on a first path of the target element and a path of each node of the second DOM tree corresponding to the current data, updating a path in buried point configuration information of the target element from the first path to a second path of the mapping node in the second DOM tree when the structure of the target page is changed, and updating the buried point of the target element based on the updated buried point configuration information, so that the buried point corresponding to the target element continuously acquires data of the target element without reconfiguration of buried point personnel, and the stability and the continuity of data acquisition are improved.
The following describes an example of a scenario to which the mapping method for page elements in the embodiment of the present application is applied.
In a first scenario, in a point burying system, when a target page provided with buried points changes, current data and reference data of the target page are obtained, and the reference data is page content data before the target page changes. And then determining mapping nodes corresponding to the target elements from all nodes of the second DOM tree according to the path of each node in the second DOM tree corresponding to the current data and the first path of the target elements. And then updating the path in the buried point configuration information corresponding to the target element from the first path to a second path of the mapping node in a second DOM tree.
And a second scenario, in the interface test system, when the test page changes, acquiring current data and reference data of the test page, wherein the reference data is page content data before the test page changes. And then determining mapping nodes corresponding to the target elements from all nodes of the second DOM tree according to the path of each node in the second DOM tree corresponding to the current data and the first path of the target elements. And then testing the mapping elements corresponding to the mapping nodes in the test page.
Referring to fig. 2, a system architecture diagram applicable to the embodiment of the present application is shown, where the system architecture includes at least a user terminal 101, a buried point terminal 102, and a buried point server 103.
The target page in the embodiment of the application may be a webpage, a page of an application program (APP), a page of an applet, and the like. A browser such as IE, Firefox, Chrome, Safari, Opera, or the like may be installed in the user terminal 101, and then a target page is loaded in the browser based on a user operation. The user terminal 101 may also install an application program therein and then load a target page through the application program. A Software Development Kit (SDK) is embedded in the target page, the SDK configures a buried point corresponding to a page element in the target page based on the configuration information of the buried point, and when a user operates the page element in the target page, operation data obtained by monitoring the buried point is collected, and the operation behavior of the user includes, but is not limited to, entering the page, clicking the page element, sliding the page element, and the like.
For example, the target page is set as a member registration page, the target element is a "confirm" button, the member registration page is as shown in fig. 2, after the user fills in basic information such as name, date of birth, mobile phone number and the like in the member registration page, the "confirm" button is clicked, and the operation behavior of clicking the "confirm" button by the user can be monitored by a buried point corresponding to the target element. User terminal 101 may include one or more processors 1011, memory 1012, I/O interface 1013 to interact with the buried point server 103, and display panel 1014, among other things. The user terminal 101 may be, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, and the like.
The buried point terminal 102 is installed with a buried point configuration application, and a buried point worker can enter a buried point operation page in the buried point configuration application and then configure the buried point configuration information of the page element in the buried point operation page. The embedded point terminal 102 may also be installed with a browser, and then an embedded point operation page is opened through the browser, and an embedded point person configures the embedded point configuration information of the page element in the embedded point operation page.
Illustratively, a buried point operation page is shown in fig. 3, the buried point operation page includes a buried point item list, and a buried point person adds a page needing buried point by clicking "new item", then selects a page element of the buried point in the page, and may add information such as name, number and the like of the page element. In addition, the site burying personnel can click a 'view' button to view the existing site burying item a in the site burying item list. The buried point terminal 102 may include one or more processors 1021, memory 1022, an I/O interface 1023 to interact with the buried point server 103, and a display panel 1024, among other things. The buried point terminal 102 may be, but is not limited to, a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, and the like.
The buried point server 103 is connected to the user terminal 101 and the buried point terminal 102 in communication. When the embedded point configuration information of the page elements in the target page is configured, the embedded point server 103 obtains reference data of the target page, and then analyzes the target page according to the reference data to determine the page elements which can be embedded in the target page. And then generating a buried point operation page based on the page elements which can be buried points, and sending the buried point operation page to the buried point terminal 102. The site burying personnel operates on a site burying operation page displayed on the site burying terminal 102, for example, selects a page element of a target page, adds information such as a name and a number of the page element, and submits the information. The embedded point terminal 102 sends embedded point configuration information of the page element to the embedded point server 103, wherein the embedded point configuration information includes information such as a path, a name, a number and the like of the page element, and the embedded point server 103 stores the embedded point configuration information of the page element. The user terminal 101 sends a buried point information acquisition request to the buried point server 103 according to a preset policy. After receiving the request, the buried point server 103 sends the buried point configuration information of the page element to the user terminal 101. The SDK in the user terminal 101 configures the first buried point of the page element in the target page based on the buried point configuration information of the page element. When a user operates a page element in a target page, a first embedded point can monitor the operation of the page element by the user, and the SDK sends operation data obtained by monitoring the first embedded point to the embedded point server 103. The embedded point server 103 may analyze the collected user operation data to obtain some basic indexes for measuring the product state, such as liveness, exposure, the number of newly added users, and the like.
When the target page changes, the buried point server 103 acquires current data of the target page, and then determines a target element which can cause corresponding change of the current data in each page element of the reference data and a first path of the target element in a first DOM tree corresponding to the reference data according to the current data of the target page and the reference data. And determining a mapping node corresponding to the target element from each node of the second DOM tree according to the path of each node in the second DOM tree corresponding to the current data and the first path. And then updating the path in the buried point configuration information corresponding to the target element from the first path to a second path of the mapping node in a second DOM tree. The user terminal 101 sends a buried point information acquisition request to the buried point server 103 according to a preset policy. When receiving a buried point information acquisition request sent by the user terminal 101, the buried point server 103 sends the updated buried point configuration information of the target element to the user terminal 101. The SDK in the user terminal 101 configures a second buried point of the mapping element corresponding to the mapping node in the target page based on the updated buried point configuration information of the target element. When the user operates the mapping element in the target page, the second embedded point may monitor the operation of the user on the mapping element, and the SDK sends the operation data obtained by monitoring the second embedded point to the embedded point server 103.
The buried point server 103 may include one or more processors 1031, memory 1032, and I/O interface 1033 to interact with the user terminal 101 and the buried point terminal 102, among other things. In addition, server 102 may also configure database 1034. The embedded point server 103 may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a network service, cloud communication, a middleware service, a domain name service, a security service, a CDN, a big data and artificial intelligence platform, and the like. The user terminal 101, the buried point terminal 102 and the buried point server 103 may be directly or indirectly connected through wired or wireless communication, and the present application is not limited herein.
Based on the system architecture diagram shown in fig. 1, an embodiment of the present application provides a flow of a mapping method for a page element, as shown in fig. 4, the flow of the method is executed by a mapping apparatus for a page element, which may be a fixed point server shown in fig. 1, and includes the following steps:
step S401, current data and reference data of the target page are obtained.
Specifically, the reference data is obtained according to a reference page of the target page, the reference page is the target page before the change occurs, and the target page may be changed one or more times. The page element mapping device may periodically obtain the data of the target page, or may obtain the data of the target page after receiving a page change message sent by the SDK of the user terminal.
Illustratively, the mapping means for setting page elements acquires the current data of the target page every day from 10 days in 1 month to 12 days in 1 month, and the target page updates the page contents at 12 days in 1 month. After acquiring the current data of the target page in 12 days in 1 month, the page element mapping device takes the current data acquired in 11 days in 1 month as reference data, and takes the target page in 11 days in 1 month as a reference page. If the target page updates the page content again in 1 month and 13 days, the mapping device of the page element acquires the current data of the target page in 1 month and 13 days, and then takes the current data acquired in 1 month and 12 days as reference data and the target page in 1 month and 12 days as a reference page.
Step S402, determining a target element which can cause the current data to be correspondingly changed in each page element of the reference data, and a first path of the target element in a first Document Object Model (DOM) tree corresponding to the reference data.
Specifically, for any page element in the reference data, the page element is compared with each page element in the current data, and if there is no page element in the current data that is the same as the page element, it is indicated that the page element causes a corresponding change in the current data, that is, the page element in the target page changes, so that the page element is determined to be the target element, and the target page may include one or more target elements. In a specific implementation, a diff function may be used to determine the target elements of the target page that have changed.
Illustratively, the target page is set as a video playing page, for the page element of the "play" button, the page element is compared with each page element in the current data of the target page, and if the "play" button is not present in the current data, the page element of the "play" button is determined as the target element.
The first DOM tree corresponding to the reference data can be obtained through analysis based on the reference data of the target page, and the first path of the target element in the first DOM tree can be obtained by searching the root node in the first DOM tree to the node corresponding to the target element. Illustratively, the first DOM tree obtained by parsing the reference data of the target page is, as shown in fig. 5, that the target element is i.icon, and a first path, specifically, body.
Step S403, determining a mapping node corresponding to the target element from each node of the second DOM tree according to the path of each node in the second DOM tree corresponding to the current data and the first path.
Specifically, the second DOM tree corresponding to the current data can be obtained through parsing based on the current data of the target page, a root node in the second DOM tree is traversed to each node, and a path of each node in the second DOM tree is obtained. And comparing the path of each node in the second DOM tree with the first path of the target element, and determining the mapping node which is most similar to the target element from each node in the second DOM tree.
In the embodiment of the application, a target element which is changed in a target page is determined by comparing current data and reference data of the target page, and then a mapping node corresponding to the target element is determined from each node of a second DOM tree based on a first path of the target element in a first DOM tree corresponding to the reference data and a path of each node in a second DOM tree corresponding to the current data, so that when the structure of the target page is changed, the configuration of the target element can be directly modified based on a second path of the mapping node in the second DOM tree, and then the changed target element is monitored or tested without related personnel paying attention to the change of the page in real time, and the path of the target element is obtained again for configuration when the page is changed, so that the stability and the continuity of page monitoring are improved, and the time and labor cost are reduced.
In one possible implementation manner, for the buried point system, after the mapping node corresponding to the target element is determined from each node of the second DOM tree, the path in the buried point configuration information corresponding to the target element is updated from the first path to the second path of the mapping node in the second DOM tree.
Specifically, the buried point configuration information of the target element includes information such as a path, a name, and a number of the target element. When the structure of the target page changes, the path in the embedded point configuration information of the target element is updated from the first path to the second path of the mapping node in the second DOM tree, and then the embedded point of the target element is updated based on the updated embedded point configuration information, so that the data of the target element is continuously acquired by the embedded point corresponding to the target element without being reconfigured by embedded point personnel, and the stability and the continuity of data acquisition are improved.
According to a possible implementation manner, after the mapping node corresponding to the target element is determined from each node of the second DOM tree, the mapping element corresponding to the mapping node in the target page is tested. When the structure of the target page is changed, the mapping elements corresponding to the mapping nodes are directly tested without retesting the whole target page, so that the testing efficiency is improved, and the time and the labor cost are saved.
Optionally, in step S401, the current data of the target page is crawled from the target page by a web crawler. Specifically, the system architecture of the Web crawler is shown in fig. 6, and includes a Web layer, an external calling layer, a service layer, and a storage layer.
The Web layer provides an operable interface for a user, and specifically comprises a visual task configuration platform and a data analysis monitoring platform. The external calling layer comprises various interface services. The service layer comprises a scheduling service module, a configuration module, a permission module, a crawling module, a cleaning module and a warehousing module, wherein the scheduling service module comprises functions of timing scheduling, machine monitoring, distributed management, task monitoring keep-alive and the like. The configuration module comprises a task configuration function and an agent configuration function. The authority module is used for authority management. The crawling module comprises functions of reverse crawling, a browser engine, pre-preprocessing, content identification and the like. The cleaning module comprises the functions of duplicate removal and verification, sensitive word cleaning, general cleaning and the like. The warehousing module comprises warehousing configuration and warehousing distribution functions. The storage layer stores data using a Remote Dictionary service (Redis).
And a crawler application program can be installed on the embedded point terminal, and a crawler task configuration interface or a data analysis monitoring interface is loaded through the crawler application program. And a browser can be installed on the embedded point terminal, and a crawler task configuration interface or a data analysis monitoring interface is loaded through the browser. Illustratively, the crawler task configuration interface is specifically shown in fig. 7, when a user needs to obtain current data of a target page, a crawler task is newly built in the crawler task configuration interface, then information such as an address, a task name, and a project name of the target page is input, and then a "next" button is clicked to submit. And the scheduling service module of the crawler server pulls the configured crawler task from the configuration module according to the scheduling strategy, and the crawling module is called after the permission module performs permission verification on the configured crawler task. The crawling module crawls current data of the target page based on the configured crawler task, then sends the crawled current data of the target page to the cleaning module, and the cleaning module cleans the current data of the target page and then sends the cleaned current data to the storage module. The crawler server can crawl current data of the target page periodically and then send the crawled current data of the target page to the buried point server. The crawler server and the embedded point server may be independent servers, or may be integrated in one server, and the present application is not limited specifically. The current data of the target page is crawled regularly by a web crawler, so that the change of the target page can be known conveniently in time, and the embedded point of the target page is updated.
Optionally, in step S403, the mapping apparatus of the page element determines the mapping node corresponding to the target element from each node of the second DOM tree, which specifically includes the following steps, as shown in fig. 8:
step S801, comparing the tag in the path of each node in the second DOM tree with the tag in the first path, respectively, and determining the tag in the path of each node that is the same as the tag in the first path.
Specifically, different types of nodes are included in the DOM tree, such as a root node, an element node, an attribute node, a text node, an annotation node, and the like, and each node corresponds to one tag. And traversing the root node to each node in the second DOM tree to obtain the path of each node in the second DOM tree.
Exemplarily, setting the second DOM tree as shown in fig. 9, the second DOM tree includes 10 nodes, which are 1 root node, 5 element nodes, 1 attribute node, and 3 text nodes, respectively.
Aiming at a text node with a label of 'main title', finding a path from a root node html to the text node, and obtaining the path of the text node as html > head > title > 'main title', wherein the label in the path comprises html, head, title and 'main title'.
Aiming at a text node with a label of 'friendship link', finding a path from a root node html to the text node, and obtaining the path of the text node as html > body > a > 'friendship link', wherein the label in the path comprises html, body, a and 'friendship link'.
Aiming at an element node with a label of h1, finding a path from a root node html to the element node, and obtaining the path of the element node as html > body > h1, wherein the label in the path comprises html, body and h 1. The path obtaining manner of other nodes in the second DOM tree is the same as that of the three nodes, and is not described herein again.
And searching a root node in the first DOM tree to a node corresponding to the target element, and obtaining a first path of the target element in the first DOM tree. Exemplarily, by parsing the reference data of the target page, the obtained first DOM tree is as shown in fig. 10, where the node corresponding to the target element is a text node, the tag is an "associated link", html from the root node to the text node with the tag being the "associated link" is searched for, and a first path is obtained, specifically, html > body > a > "associated link", where the tag in the path includes html, body, a, "friend link".
When comparing the tag in the path of the node with the tag in the first path, the tag in the path of the node may be compared step by step from the root node to determine the same tag, or each tag in the path of the node may be compared with each tag in the first path, and this is not particularly limited in this application.
Illustratively, for a text node labeled "friendly link" in the second DOM tree, the path of the text node is html > body > a > "friendly link", and the first path corresponding to the target element in the first DOM tree is html > body > a > "associated link". Firstly, comparing the labels of the first level, and obtaining html which is the label in the path of the text node and the label in the first path. And then comparing the labels of the second level to obtain that the labels in the path of the text node and the labels in the first path are both body, then comparing the labels of the third level to obtain that the labels in the path of the text node and the labels in the first path are both a, and finally comparing the labels of the fourth level to obtain that the labels in the path of the text node are 'friend links' and the labels in the first path are 'associated links'. The final comparison results obtained were: the same labels in the path of the text node as in the first path are html, body, a.
Illustratively, for an element node labeled h1 in the second DOM tree, the path of the element node is html > body > h1, and the first path corresponding to the target element in the first DOM tree is html > head > title > "associated link". And aiming at the tag html in the path of the element node, comparing the tag html with each tag in the first path respectively, and determining that the same tag html exists in the first path. And comparing the label body with each label in the first path respectively aiming at the label body in the path of the element node, and determining that the same label body does not exist in the first path. For tag h1 in the path of the element node, tag h1 is compared with each tag in the first path, respectively, to determine that the same tag h1 does not exist in the first path. The final comparison results obtained were: the same tag in the path of the element node as in the first path is html.
Step S802, determining the weight of each node in the second DOM tree according to the same label as the label in the first path.
Specifically, the weight of each label in the DOM tree is preset, the weight of each label may be set to be the same, or the weight of the corresponding label may be set according to the type of the node. For example, the weight of the tag of each node in the DOM tree is set to 1, or for example, the weight of the tag corresponding to the root node in the DOM tree is set to 1, the weight of the tag corresponding to the element node in the DOM tree is set to 2, the weight of the tag corresponding to the attribute node in the DOM tree is set to 3, and the weight of the tag corresponding to the text node in the DOM tree is set to 4.
After the label in the path of each node, which is the same as the label in the first path, is determined, the weights corresponding to the same labels are summed or weighted and summed to obtain the weight of each node in the second DOM tree.
Illustratively, the weight of the tag corresponding to the root node in the second DOM tree is set to 1, the weight of the tag corresponding to the element node and the attribute node in the second DOM tree is set to 2, and the weight of the tag corresponding to the text node in the second DOM tree is set to 3.
And aiming at the text node of which the label is the "friend link" in the second DOM tree, the labels in the path of the text node, which are the same as those in the first path, are html, body and a, wherein the weight of the html label is 1, and the weights of the body label and the a label are both 2, so that the weight of the text node is 5.
And aiming at the text node of which the label is the main title in the second DOM tree, the label in the path of the text node, which is the same as that in the first path, is html, wherein the weight of the html label is 1, and the weight of the element node is 1.
For an element node with a label of h1 in the second DOM tree, the same label in the path of the element node as in the first path is html, wherein the weight of the html label is 1, and the weight of the element node is 1.
And step S803, taking the node with the maximum weight as the corresponding mapping node of the target element in the second DOM tree.
Specifically, each node in the second DOM tree is sorted from large to small according to the weight, and the node arranged at the first is used as a corresponding mapping node of the target element in the second DOM tree. For example, in the second DOM tree shown in fig. 9, the text node labeled "friendly link" is set to have the largest weight, and then the text node labeled "friendly link" is used as the corresponding mapping node of the target element in the second DOM tree.
When a plurality of nodes with the maximum weight exist in the second DOM tree, a person with a buried point can further determine a mapping node from the nodes with the maximum weight through visual analysis, and can also directly judge that a target element is lost in a target page after the target page is updated, and then an alarm message is generated to related persons.
Because the paths of the similar page elements in the DOM are also likely to be similar, after the tags in the path of each node in the second DOM tree are respectively compared with the tags in the first path, the mapping nodes of the target elements can be effectively determined from the nodes of the second DOM tree, and the accuracy of updating the buried points is further improved.
Optionally, the embedded point configuration information corresponding to the target element is initially configured and obtained on the embedded point terminal by the embedded point personnel, as shown in fig. 11, specifically including the following steps, which are interactively executed by the embedded point terminal and the embedded point server:
in step S1101, the buried point server generates a buried point operation page according to the reference data of the target page.
Specifically, the buried point server analyzes the target page according to the reference data, determines page elements which can be buried in the target page, and generates a buried point operation page based on the page elements which can be buried.
Step S1102, the embedded point server sends the embedded point operation page to the embedded point terminal.
In step S1103, the buried point terminal receives a buried point configuration instruction of the target element, which is input by the buried point operator in the buried point operation page.
Specifically, the site burying personnel can select or click a target element in the site burying operation page, and then add information such as the name and the number of the target element and submit the information.
In step S1104, the buried point terminal generates buried point configuration information of the target element according to the buried point configuration instruction of the target element.
In step S1105, the buried point terminal sends the buried point configuration information of the target element to the buried point server.
Specifically, the buried point server stores the buried point configuration information of the target element. The embedded point server generates the embedded point operation page based on the data of the target page, so that embedded point personnel can directly realize embedded point configuration in the embedded point operation interface without writing codes for embedding points by technical personnel, thereby saving time and labor cost and simultaneously improving the timeliness of data acquisition.
Optionally, the user terminal obtains the buried point configuration information from the buried point server according to a preset policy, and then configures the buried point and collects data based on the buried point configuration information, as shown in fig. 12, the method specifically includes the following steps, and the steps are performed by the user terminal and the buried point server in an interactive manner:
step S1201, the user terminal sends a buried point information acquisition request to the buried point server.
Specifically, the target page is embedded with the SDK, and when the user opens the target page at the user terminal, the SDK sends a buried point information acquisition request to the buried point server through the user terminal. The user terminal may periodically send a buried point information acquisition request to the buried point server, may also determine whether to send the buried point information acquisition request to the buried point server according to the current network load condition, and may also send the buried point information acquisition request based on other strategies, which is not specifically limited in this application.
Step S1202, the buried point server sends the buried point configuration information of the target element to the user terminal.
In step S1203, the user terminal configures a first buried point of the target element in the target page according to the buried point configuration information of the target element.
Specifically, the SDK in the target page configures a first buried point of the target element in the target page based on the buried point configuration information of the target element, and the first buried point is used for monitoring the operation behavior of the user on the target element in the target page.
In step S1204, the user terminal receives an operation instruction of the target element input by the user on the target page.
Step S1205, the user terminal sends the operation data of the target element obtained by the first buried point monitoring to the buried point server.
Specifically, the operation instruction comprises a click target element, a slide target element and the like, for example, the target element is a "friend link" in a target page, when a user clicks the "friend link" on the target page, the first embedded point monitors the operation behavior of the user clicking the "friend link", the SDK collects click operation data of the "friend link" acquired by the first embedded point monitoring, and then the click operation data is sent to the embedded point server. After receiving the data collected by the buried points, the buried point server can analyze the data to obtain the states of the products corresponding to the target page, such as liveness, exposure and the like.
Optionally, when the buried point configuration information of the target element is updated, the user terminal may update the buried point and collect data based on the updated buried point configuration information, as shown in fig. 13, specifically including the following steps, which are performed by the user terminal and the buried point server interactively:
step S1301, the user terminal sends a request for acquiring the embedded point information to the embedded point server.
In step S1302, the buried point server sends the updated buried point configuration information of the target element to the user terminal.
Step S1303, the user terminal configures, according to the updated buried point configuration information of the target element, a second buried point of the mapping element corresponding to the mapping node in the target page.
Specifically, when the target page changes, the target element is updated to the mapping element in the target page, for example, before the target page changes, the target element is a "friend link" in the target page, and after the target page changes, the mapping element corresponding to the mapping node is an "associated link". Because the paths corresponding to the target element 'friendly link' and the mapping element 'associated link' in the DOM tree are different, when a user clicks the 'associated link' in the changed target page, the first embedded point of the target element 'friendly link' is monitored, and the operation behavior of the user clicking the mapping element 'associated link' cannot be monitored. In view of this, the SDK in the target page configures, based on the updated buried point configuration information of the target element, a second buried point of the mapping element corresponding to the mapping node in the target page, where the second buried point is used to monitor an operation behavior of the user on the mapping element in the target page.
In step S1304, the user terminal receives an operation instruction of the mapping element input by the user on the target page.
Step S1305, the user terminal sends the operation data of the mapping element obtained by the second site monitoring to the site server.
Specifically, the operation instruction includes a click mapping element, a slide mapping element, and the like. For example, the mapping element is an "associated link" in the target page, when the user clicks the "associated link" on the target page, the second embedded point monitors the behavior of the user clicking the "associated link", the SDK collects click operation data of the "associated link" acquired by the second embedded point monitoring, and then sends the click operation data to the embedded point server. And updating the buried point configuration of the target element based on the updated buried point configuration information, so that the buried point corresponding to the target element continuously acquires the data of the target element without reconfiguration of buried point personnel, thereby improving the stability and continuity of data acquisition and reducing the labor and time costs.
To better explain the embodiment of the present application, a buried point system is taken as an example below to describe a page element mapping method provided in the embodiment of the present application, where the buried point system includes a buried point server, a buried point terminal, and a user terminal, and first a process of configuring buried points and acquiring data by the buried point system before a target page changes is described, as shown in fig. 14, the method includes the following steps:
step 1401, the embedded point server obtains reference data of the target page through the web crawler.
Specifically, the reference data of the target page is page content data before the target page is changed.
In step S1402, the embedded point server generates an embedded point operation page according to the reference data of the target page.
Specifically, the buried point server analyzes the target page according to the reference data, determines page elements which can be buried in the target page, and generates a buried point operation page based on the page elements which can be buried.
Step S1403, the buried point server sends the buried point operation page to the buried point terminal.
In step S1404, the buried point terminal receives a buried point configuration instruction of the target element input by the buried point worker in the buried point operation page.
Step S1405, the buried point terminal generates buried point configuration information of the target element according to the buried point configuration instruction of the target element.
In step S1406, the buried point terminal sends the buried point configuration information of the target element to the buried point server.
Step S1407, the user terminal sends a request for obtaining the information of the embedded point to the embedded point server.
Specifically, the target page is embedded with the SDK, and when the user opens the target page at the user terminal, the SDK sends a buried point information acquisition request to the buried point server through the user terminal.
In step S1408, the burial point server sends the burial point configuration information of the target element to the user terminal.
Step S1409, the user terminal configures the first buried point of the target element in the target page according to the buried point configuration information of the target element.
Specifically, the SDK in the target page configures a first buried point of the target element in the target page based on the buried point configuration information of the target element, and the first buried point is used for monitoring the operation behavior of the user on the target element in the target page.
In step S1410, the user terminal receives an operation instruction of the target element input by the user on the target page.
In step S1411, the user terminal sends the operation data of the target element obtained by the first site monitoring to the site server.
The embedded point server generates the embedded point operation page based on the data of the target page, so that embedded point personnel can directly realize embedded point configuration in the embedded point operation interface without writing codes for embedding points by technical personnel, thereby saving time and labor cost and simultaneously improving the timeliness of data acquisition.
Next, describing the process of configuring the burial point and collecting data by the burial point system after the target page is changed, as shown in fig. 15, the method includes the following steps:
in step S1501, the embedded point server obtains current data of the target page through the web crawler.
In step S1502, the buried point server determines a target element, which may cause a corresponding change to the current data, in each page element of the reference data, and a first path of the target element in the first DOM tree corresponding to the reference data.
Step S1503, the buried point server compares the label in the path of each node in the second DOM tree with the label in the first path, respectively, and determines the label in the path of each node that is the same as the label in the first path.
In step S1504, the buried point server determines the weight of each node in the second DOM tree according to the same tag as the tag in the first path.
In step S1505, the buried point server uses the node with the largest weight as the corresponding mapping node of the target element in the second DOM tree.
In step S1506, the buried point server updates the path in the buried point configuration information corresponding to the target element from the first path to a second path of the mapping node in the second DOM tree.
In step S1507, the user terminal sends a request for acquiring the embedded point information to the embedded point server.
In step S1508, the burial point server sends the updated burial point configuration information of the target element to the user terminal.
Step S1509, the user terminal configures a second buried point of the mapping element corresponding to the mapping node in the target page according to the updated buried point configuration information of the target element.
Specifically, when the target page changes, the target element is updated to be a mapping element in the target page, the SDK in the target page configures a second embedded point of the mapping element corresponding to the mapping node in the target page based on the updated embedded point configuration information of the target element, and the second embedded point is used for monitoring an operation behavior of the user on the mapping element in the target page.
In step S1510, the user terminal receives an operation instruction of the mapping element input by the user on the target page.
Step S1511, the user terminal sends the operation data of the mapping element obtained by the second buried point monitoring to the buried point server.
The method comprises the steps of determining a changed target element in a target page by comparing current data of the target page with reference data, determining a mapping node corresponding to the target element from each node of a second DOM tree based on a first path of the target element and a path of each node of the second DOM tree corresponding to the current data, updating a path in buried point configuration information of the target element from the first path to a second path of the mapping node in the second DOM tree when the structure of the target page is changed, and updating the buried point configuration of the target element based on the updated buried point configuration information, so that the buried point corresponding to the target element continuously acquires data of the target element without reconfiguration of buried point personnel, thereby improving the stability and the continuity of data acquisition.
To better explain the embodiment of the present application, an interface test system is taken as an example to describe a page element mapping method provided in the embodiment of the present application, where the method is executed by a test server in the interface test system, as shown in fig. 16, and includes the following steps:
step S1601, the test server obtains current data and reference data of the test page.
Specifically, the reference data of the test page is page content data before the test page is changed.
In step S1602, the test server determines, by using a diff function, target elements among the page elements of the reference data, which may cause corresponding changes to the current data.
Step S1603, the test server compares the label in the path of each node in the second DOM tree with the label in the first path, respectively, and determines the label in the path of each node that is the same as the label in the first path.
Specifically, the first path is a path of the target element in the first DOM tree corresponding to the reference data.
In step S1604, the test server determines a weight of each node in the second DOM tree according to the same tag as the tag in the first path.
Step S1605, the test server takes the node with the largest weight as the mapping node corresponding to the target element in the second DOM tree.
Step S1606, the test server tests the mapping elements corresponding to the mapping nodes in the test page.
The method comprises the steps of determining a target element which is changed in a target page by comparing current data and reference data of the target page, and then determining a mapping node corresponding to the target element from each node of a second DOM tree based on a first path of the target element and a path of each node in the second DOM tree corresponding to the current data, so that when the structure of the target page is changed, the mapping element corresponding to the mapping node can be directly tested without retesting the whole target page, thereby improving the testing efficiency and saving time and labor cost.
Based on the same technical concept, an embodiment of the present application provides an apparatus for mapping a page element, as shown in fig. 17, the apparatus 1700 includes:
an obtaining module 1701, configured to obtain current data and reference data of a target page, where the reference data is obtained according to a reference page of the target page;
a comparing module 1702, configured to determine a target element, which may cause a corresponding change to current data, in each page element of the reference data, and a first path of the target element in a DOM tree of a first document object model corresponding to the reference data;
and a mapping module 1703, configured to determine, according to the path of each node in the second DOM tree corresponding to the current data and the first path, a mapping node corresponding to the target element from each node in the second DOM tree.
Optionally, a buried point module 1704;
the buried point module 1704 is specifically configured to:
and updating the path in the buried point configuration information corresponding to the target element from the first path to a second path of the mapping node in a second DOM tree.
Optionally, the mapping module 1703 is specifically configured to:
comparing the label in the path of each node in the second DOM tree with the label in the first path respectively, and determining the label in the path of each node, which is the same as the label in the first path;
determining the weight of each node in the second DOM tree according to the same label as the label in the first path;
and taking the node with the maximum weight as a corresponding mapping node of the target element in the second DOM tree.
Optionally, the current data of the target page is crawled from the target page by a web crawler.
Optionally, the buried point module 1704 is further configured to:
generating a buried point operation page according to the reference data of the target page, and sending the buried point operation page to the buried point terminal;
receiving buried point configuration information of a target element sent by a buried point terminal, wherein the buried point configuration information of the target element is generated after the buried point terminal receives a buried point configuration instruction of the target element input by buried point personnel in a buried point operation page;
and sending the buried point configuration information of the target element to a user terminal so that the user terminal configures a first buried point of the target element in the target page according to the buried point configuration information of the target element, and sending operation data of the target element, obtained by monitoring the first buried point, to a buried point server when receiving an operation instruction of the target element input by a user in the target page.
Optionally, the buried point module 1704 is further configured to:
and sending the updated buried point configuration information of the target element to a user terminal so that the user terminal configures a second buried point of the mapping element corresponding to the mapping node in the target page according to the updated buried point configuration information of the target element, and sending operation data of the mapping element obtained by monitoring the second buried point to a buried point server when receiving an operation instruction of the mapping element input by a user in the target page.
Based on the same technical concept, the embodiment of the present application provides a computer device, as shown in fig. 18, including at least one processor 1801 and a memory 1802 connected to the at least one processor, where a specific connection medium between the processor 1801 and the memory 1802 is not limited in this embodiment, and the processor 1801 and the memory 1802 in fig. 18 are connected through a bus as an example. The bus may be divided into an address bus, a data bus, a control bus, etc.
In the embodiment of the present application, the memory 1802 stores instructions executable by the at least one processor 1801, and the at least one processor 1801 may execute the steps included in the mapping method for page elements by executing the instructions stored in the memory 1802.
The processor 1801 is a control center of the computer device, and may connect various portions of the computer device by using various interfaces and lines, and execute or execute instructions stored in the memory 1802 and call data stored in the memory 1802, thereby obtaining a mapping node of a target element. Optionally, the processor 1801 may include one or more processing units, and the processor 1801 may integrate an application processor and a modem processor, where the application processor mainly handles an operating system, a user interface, application programs, and the like, and the modem processor mainly handles wireless communication. It is to be appreciated that the modem processor described above may not be integrated into the processor 1801. In some embodiments, the processor 1801 and the memory 1802 may be implemented on the same chip, or in some embodiments, they may be implemented separately on separate chips.
The processor 1801 may be a general-purpose processor, such as a Central Processing Unit (CPU), a digital signal processor, an Application Specific Integrated Circuit (ASIC), a field programmable gate array or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof, and may implement or perform the methods, steps, and logic blocks disclosed in the embodiments of the present Application. A general purpose processor may be a microprocessor or any conventional processor or the like. The steps of a method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware processor, or may be implemented by a combination of hardware and software modules in a processor.
Memory 1802, which is a non-volatile computer-readable storage medium, may be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. The Memory 1802 may include at least one type of storage medium, and may include, for example, a flash Memory, a hard disk, a multimedia card, a card-type Memory, a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Programmable Read Only Memory (PROM), a Read Only Memory (ROM), a charge Erasable Programmable Read Only Memory (EEPROM), a magnetic Memory, a magnetic disk, an optical disk, and so on. The memory 1802 is any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to such. The memory 1802 of the embodiments of the present application may also be circuitry or any other device capable of performing a storage function for storing program instructions and/or data.
Based on the same inventive concept, embodiments of the present application provide a computer-readable storage medium storing a computer program executable by a computer device, which, when the program is run on the computer device, causes the computer device to perform the steps of the above-mentioned mapping method for page elements.
It should be apparent to those skilled in the art that embodiments of the present invention may be provided as a method, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (14)

1. A method for mapping page elements, comprising:
acquiring current data and reference data of a target page, wherein the reference data is acquired according to a reference page of the target page;
determining a target element which can cause corresponding change of the current data in each page element of the reference data and a first path of the target element in a first Document Object Model (DOM) tree corresponding to the reference data;
and determining a mapping node corresponding to the target element from each node of the second DOM tree according to the path of each node in the second DOM tree corresponding to the current data and the first path.
2. The method of claim 1, further comprising:
and updating the path in the buried point configuration information corresponding to the target element from the first path to a second path of the mapping node in the second DOM tree.
3. The method of claim 2, wherein determining the mapping node corresponding to the target element from the nodes in the second DOM tree according to the path of each node in the second DOM tree corresponding to the current data and the first path comprises:
comparing the label in the path of each node in the second DOM tree with the label in the first path respectively, and determining the label in the path of each node, which is the same as the label in the first path;
determining a weight of each node in the second DOM tree according to the same label as the label in the first path;
and taking the node with the maximum weight as a corresponding mapping node of the target element in the second DOM tree.
4. The method of claim 2, wherein the current data of the target page is crawled from the target page by a web crawler.
5. The method according to any one of claims 2 to 4, wherein obtaining the corresponding buried point configuration information of the target element by using the following method specifically comprises:
generating a buried point operation page according to the reference data of the target page, and sending the buried point operation page to a buried point terminal;
receiving the buried point configuration information of the target element sent by the buried point terminal, wherein the buried point configuration information of the target element is generated after the buried point terminal receives a buried point configuration instruction of the target element input by a buried point operator in the buried point operation page;
and sending the buried point configuration information of the target element to the user terminal so that the user terminal configures a first buried point of the target element in the target page according to the buried point configuration information of the target element, and sending operation data of the target element, obtained by monitoring the first buried point, to a server when receiving an operation instruction of the target element input by a user on the target page.
6. The method of claim 5, further comprising:
and sending the updated embedded point configuration information of the target element to the user terminal so that the user terminal configures a second embedded point of the mapping element corresponding to the mapping node in the target page according to the updated embedded point configuration information of the target element, and sending operation data of the mapping element obtained by monitoring the second embedded point to a server when receiving an operation instruction of the mapping element input by a user on the target page.
7. An apparatus for mapping page elements, comprising:
the acquisition module is used for acquiring current data and reference data of a target page, wherein the reference data is acquired according to a reference page of the target page;
the comparison module is used for determining a target element which can cause the current data to be correspondingly changed in each page element of the reference data and a first path of the target element in a first Document Object Model (DOM) tree corresponding to the reference data;
and the mapping module is used for determining a mapping node corresponding to the target element from each node of the second DOM tree according to the path of each node in the second DOM tree corresponding to the current data and the first path.
8. The apparatus of claim 7, further comprising a buried point module;
the buried point module is specifically configured to:
and updating the path in the buried point configuration information corresponding to the target element from the first path to a second path of the mapping node in the second DOM tree.
9. The apparatus of claim 8, wherein the mapping module is specifically configured to:
comparing the label in the path of each node in the second DOM tree with the label in the first path respectively, and determining the label in the path of each node, which is the same as the label in the first path;
determining a weight of each node in the second DOM tree according to the same label as the label in the first path;
and taking the node with the maximum weight as a corresponding mapping node of the target element in the second DOM tree.
10. The apparatus of claim 8, wherein the current data of the target page is crawled from the target page by a web crawler.
11. The apparatus of any of claims 8 to 10, wherein the buried point module is further configured to:
generating a buried point operation page according to the reference data of the target page, and sending the buried point operation page to a buried point terminal;
receiving the buried point configuration information of the target element sent by the buried point terminal, wherein the buried point configuration information of the target element is generated after the buried point terminal receives a buried point configuration instruction of the target element input by a buried point operator in the buried point operation page;
and sending the buried point configuration information of the target element to the user terminal so that the user terminal configures a first buried point of the target element in the target page according to the buried point configuration information of the target element, and sending operation data of the target element, obtained by monitoring the first buried point, to a server when receiving an operation instruction of the target element input by a user on the target page.
12. The apparatus of claim 10, wherein the burial point module is further to:
and sending the updated embedded point configuration information of the target element to the user terminal so that the user terminal configures a second embedded point of the mapping element corresponding to the mapping node in the target page according to the updated embedded point configuration information of the target element, and sending operation data of the mapping element obtained by monitoring the second embedded point to a server when receiving an operation instruction of the mapping element input by a user on the target page.
13. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the steps of the method of any one of claims 1 to 6 are performed by the processor when the program is executed.
14. A computer-readable storage medium, having stored thereon a computer program executable by a computer device, for causing the computer device to perform the steps of the method of any one of claims 1 to 6, when the program is run on the computer device.
CN202010378558.9A 2020-05-07 2020-05-07 Page element mapping method and device Pending CN113626028A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010378558.9A CN113626028A (en) 2020-05-07 2020-05-07 Page element mapping method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010378558.9A CN113626028A (en) 2020-05-07 2020-05-07 Page element mapping method and device

Publications (1)

Publication Number Publication Date
CN113626028A true CN113626028A (en) 2021-11-09

Family

ID=78376926

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010378558.9A Pending CN113626028A (en) 2020-05-07 2020-05-07 Page element mapping method and device

Country Status (1)

Country Link
CN (1) CN113626028A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115329236A (en) * 2022-10-17 2022-11-11 杭州金智塔科技有限公司 Method and device for determining page processing behavior of user

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103246732A (en) * 2013-05-10 2013-08-14 合肥工业大学 Online Web news content extracting method and system
CN104346405A (en) * 2013-08-08 2015-02-11 阿里巴巴集团控股有限公司 Method and device for extracting information from webpage
CN109165373A (en) * 2018-09-14 2019-01-08 联想(北京)有限公司 A kind of data processing method and device
CN109491645A (en) * 2018-10-17 2019-03-19 深圳壹账通智能科技有限公司 Point methods, device, computer equipment and storage medium are buried based on interface element
CN110196953A (en) * 2019-05-30 2019-09-03 北京腾云天下科技有限公司 A kind of application buries point methods, device, calculates equipment and system
CN110309364A (en) * 2018-03-02 2019-10-08 腾讯科技(深圳)有限公司 A kind of information extraction method and device
CN110968761A (en) * 2019-11-29 2020-04-07 福州大学 Self-adaptive extraction method for webpage structured data
CN111046317A (en) * 2019-12-27 2020-04-21 北京奇艺世纪科技有限公司 Page data acquisition method, device, equipment and computer readable storage medium
CN111079043A (en) * 2019-12-05 2020-04-28 北京数立得科技有限公司 Key content positioning method

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103246732A (en) * 2013-05-10 2013-08-14 合肥工业大学 Online Web news content extracting method and system
CN104346405A (en) * 2013-08-08 2015-02-11 阿里巴巴集团控股有限公司 Method and device for extracting information from webpage
CN110309364A (en) * 2018-03-02 2019-10-08 腾讯科技(深圳)有限公司 A kind of information extraction method and device
CN109165373A (en) * 2018-09-14 2019-01-08 联想(北京)有限公司 A kind of data processing method and device
CN109491645A (en) * 2018-10-17 2019-03-19 深圳壹账通智能科技有限公司 Point methods, device, computer equipment and storage medium are buried based on interface element
CN110196953A (en) * 2019-05-30 2019-09-03 北京腾云天下科技有限公司 A kind of application buries point methods, device, calculates equipment and system
CN110968761A (en) * 2019-11-29 2020-04-07 福州大学 Self-adaptive extraction method for webpage structured data
CN111079043A (en) * 2019-12-05 2020-04-28 北京数立得科技有限公司 Key content positioning method
CN111046317A (en) * 2019-12-27 2020-04-21 北京奇艺世纪科技有限公司 Page data acquisition method, device, equipment and computer readable storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115329236A (en) * 2022-10-17 2022-11-11 杭州金智塔科技有限公司 Method and device for determining page processing behavior of user

Similar Documents

Publication Publication Date Title
US11068323B2 (en) Automatic registration of empty pointers
US10152488B2 (en) Static-analysis-assisted dynamic application crawling architecture
US8533141B2 (en) Systems and methods for rule based inclusion of pixel retargeting in campaign management
KR101114023B1 (en) Content propagation for enhanced document retrieval
Ceri et al. Model-driven development of context-aware web applications
US8296311B2 (en) Solution search for software support
US8756593B2 (en) Map generator for representing interrelationships between app features forged by dynamic pointers
US8489474B2 (en) Systems and/or methods for managing transformations in enterprise application integration and/or business processing management environments
EP2228726B1 (en) A method and system for task modeling of mobile phone applications
Fileto et al. POESIA: An ontological workflow approach for composing Web services in agriculture
CN114791846B (en) Method for realizing observability aiming at cloud-originated chaos engineering experiment
Greene et al. Visualizing and exploring software version control repositories using interactive tag clouds over formal concept lattices
KR100987330B1 (en) A system and method generating multi-concept networks based on user's web usage data
CN113626028A (en) Page element mapping method and device
CN111427577A (en) Code processing method and device and server
Pierce et al. Using Web 2.0 for scientific applications and scientific communities
Nocera et al. MoSAIC: A middleware-induced software archIteCture design decision support system
Bajcsy et al. A meta-workflow cyber-infrastructure system designed for environmental observatories
Ordóñez et al. Dynamic reconfiguration of composite convergent services supported by multimodal search
Lyell et al. An ontology-based spatio-temporal data model and query language for use in gis-type applications
El Mhouti et al. A Web Scraping Framework for Descriptive Analysis of Meteorological Big Data for Decision-Making Purposes
Thakare et al. Discovery of Layered Software Architecture from Source Code Using Ego Networks
Privitera Creation of a web platform for event-flow visualization
Patel Ultimate search engine
ESCAP Geo DRM user manual: version 1.0 2014

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40055346

Country of ref document: HK

SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination