A dynamic element adaptive positioning method based on region frame selection

By combining dynamic element detection and minimum region expansion algorithms in RPA, the initial region is automatically expanded, solving the problem of missing element positioning in dynamic pages. This achieves efficient and accurate element recognition and operation, adapting to different resolutions and scaling ratios.

CN120821409BActive Publication Date: 2025-11-25HANGZHOU BRANCH INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511343859.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-19
Publication Date
2025-11-25
Estimated Expiration
2045-09-19

AI Technical Summary

Technical Problem

Existing Robotic Process Automation (RPA) element localization methods struggle to accurately identify and manipulate all target elements when dealing with dynamic pages, especially dynamically loaded and interactive elements, leading to omissions and decreased accuracy in localization.

Method used

By combining dynamic page changes, recording the coordinate range of the initial area, parsing the DOM structure, detecting dynamic elements, and using a minimum area expansion algorithm to automatically expand the initial area, we ensure that all operable elements, including lazy-loaded and interactive elements, are included, and optimize the expanded area to reduce redundancy.

Benefits of technology

It enables comprehensive identification and manipulation of all operable elements in a dynamic page environment, improving the success rate of RPA tasks, reducing computational resource requirements, and enhancing the robustness and cross-device adaptability of the method.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120821409B_ABST
    Figure CN120821409B_ABST
Patent Text Reader

Abstract

The application discloses a dynamic element adaptive positioning method based on a region frame selection, which comprises the following steps: step 1, receiving an initial region of a page selected by a user through an interactive operation, and recording the coordinate range of the initial region; step 2, analyzing the DOM structure of the page and extracting static elements in the initial region to generate an initial element list; step 3, taking the initial element list as a reference, performing dynamic element detection on the page to obtain a position information set of dynamic elements; and step 4, based on the position information set of the dynamic elements, expanding the initial region through a minimum region expansion algorithm to obtain a final expansion region. Through the combination of the dynamic change of the page, the automatic expansion of the user-selected region is realized, and it is ensured that RPA can comprehensively and accurately identify and operate all operable elements.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of robot process automation, and particularly relates to a dynamic element adaptive positioning method based on region frame selection. BACKGROUND

[0002] In the RPA (robot process automation) task, the user usually specifies the operation range of the element by frame selecting a certain part of the region of the page. However, due to the dynamic nature of the page elements (such as drop-down boxes, pop-up menus, dynamically loaded content, etc.), the region selected by the user may not contain all the dynamic elements, which will cause the RPA to be unable to accurately identify and operate all target elements. The existing element positioning methods mainly have the following several kinds: 1. Element positioning based on fixed coordinates, which directly extracts the elements in the region through the fixed coordinate range (such as pixel coordinates or relative position) selected by the user. However, it cannot adapt to dynamic changes and has the problem of missing potential elements. 2. Element positioning based on DOM structure, which uses selectors to locate elements by parsing the page DOM (Document Object Model) tree. Its defects are that it depends on static structure, and for dynamically loaded content that is not reflected in the initial DOM, it leads to positioning omission; at the same time, it is invalid for interactive elements (such as hovering and clicking), and cannot be directly identified by DOM. 3. Element positioning based on image recognition, which identifies the visual features of the user-selected region through image matching or OCR technology. It depends on resolution and page layout, and when the page is scaled or the resolution is poor, its accuracy decreases, and at the same time, the computational resource consumption is large, and it cannot identify interactive elements. It can be seen that the existing element positioning methods have many shortcomings in dealing with dynamic pages, which makes it difficult to cope with the complexity of dynamic page environment. SUMMARY

[0003] The purpose of the present application is to provide a dynamic element adaptive positioning method based on region frame selection. The present application realizes automatic expansion of the user-selected region by combining the dynamic changes of the page, ensuring that RPA can accurately identify and operate all operable elements.

[0004] The technical solution of the present application: a dynamic element adaptive positioning method based on region frame selection, comprising the following steps:

[0005] Step 1, receiving the initial region of the page selected by the user through interactive operation, recording the coordinate range of the initial region;

[0006] Step 2, parsing the DOM structure of the page and extracting the static elements in the initial region to generate an initial element list;

[0007] Step 3, referring to the initial element list, performing dynamic element detection on the page to obtain a set of position information of dynamic elements;

[0008] Step 4, based on the position information set of the dynamic elements, the initial region is expanded by a minimum region expansion algorithm to obtain a final expanded region.

[0009] The aforementioned dynamic element adaptive positioning method based on region framing, the coordinate range includes the upper left corner coordinate (x1, y1) and the lower right corner coordinate (x2, y2) of the initial region; the initial element list contains element type, position and attribute.

[0010] The aforementioned dynamic element adaptive positioning method based on region framing, the step of detecting dynamic elements on the page includes page dynamic loading detection; the page dynamic loading detection includes:

[0011] Listening to and identifying the content of the page dynamic loading;

[0012] Tracking and identifying lazy loading elements in the page triggered by scrolling operations;

[0013] Based on the structure characteristics of the page, the possible positions of the potential dynamic content are speculated.

[0014] The aforementioned dynamic element adaptive positioning method based on region framing, the process of tracking and identifying lazy loading elements in the page triggered by scrolling operations is:

[0015] Listen to the scroll event, detect whether the lazy loading element enters the viewport, and trigger the callback function after entering the viewport;

[0016] According to the type of the lazy loading element, load the corresponding resource, render the loaded resource to the page, and mark the element as loaded, stop observing the loaded element.

[0017] The aforementioned dynamic element adaptive positioning method based on region framing, in the process of tracking and identifying lazy loading elements, the scroll event is throttled or debounced to avoid frequent loading, and the loading time and state information are recorded for analysis and troubleshooting.

[0018] The aforementioned dynamic element adaptive positioning method based on region framing, the step of detecting dynamic elements on the page also includes interactive element analysis; the interactive element analysis includes:

[0019] Detecting elements in the page that bind interactive events to predict the child elements that may be generated after triggering;

[0020] By simulating interactive behavior, combining element size and layout rules, the complete display area of the interactive element is predicted.

[0021] The aforementioned dynamic element adaptive positioning method based on region selection includes a minimum region expansion algorithm comprising dynamic region expansion, adaptive region calculation, and minimum bounding box optimization.

[0022] The dynamic region expansion is used to expand the region range based on the initial selected region and the dynamic element detection results, so as to ensure that all relevant dynamic elements are included.

[0023] The adaptive region calculation is used to process the characteristics of different types of dynamic elements based on the dynamic region expansion, thereby determining the boundary of the expanded region and achieving a balance between full coverage of dynamic elements and region minimization.

[0024] The minimum bounding box optimization is used to balance the expanded region by minimizing the region and eliminating redundant space.

[0025] The aforementioned dynamic element adaptive positioning method based on region selection includes the following dynamic region expansion step:

[0026] For each detected dynamic element, determine its spatial relationship with the initial selection area. If the dynamic element is completely within the selection area, no expansion is needed; if the dynamic element is partially or completely outside the selection area, include it in the expansion calculation.

[0027] Calculate the minimum rectangular area that needs to be expanded, such that the minimum rectangular area includes the initial selected area and all related dynamic elements.

[0028] The aforementioned dynamic element adaptive positioning method based on region selection includes the following adaptive region calculation steps:

[0029] The processing is categorized based on the type of dynamic elements on the page: For dropdown lists, calculate their maximum height after expansion and expand the area vertically by the maximum height in pixels; for pop-up layers, obtain the pop-up layer's hierarchy information and calculate its display position and size; for dynamically loaded content, estimate the size of its display area after loading.

[0030] Construct the boundary calculation function for the extended region: , where R represents a rectangular region and di represents a dynamic element.

[0031] The aforementioned dynamic element adaptive positioning method based on region selection includes the following minimum bounding box optimization step:

[0032] Calculate the bounding rectangle of all dynamic elements that need to be included, and remove redundant space;

[0033] Applying boundary constraints, the horizontal expansion range is [x1-△x, x2+△x], and the vertical expansion range is [y1-△y, y2+△y], where △x and △y are dynamically calculated expansion values, x1 is the x-coordinate of the upper left corner of the initial region, x2 is the x-coordinate of the lower right corner of the initial region, y1 is the y-coordinate of the upper left corner of the initial region, and y2 is the y-coordinate of the lower right corner of the initial region.

[0034] Output the final coordinates of the expanded region.

[0035] Compared with the prior art, the present invention has the following beneficial effects:

[0036] 1. This invention can proactively identify and cover all potential dynamic elements through dynamic element detection and interactive element analysis. Whether it is a drop-down list, a pop-up menu, or dynamically loaded content, all can be included in the positioning range, avoiding positioning omissions caused by incomplete element display or subsequent dynamic changes, and significantly improving the success rate of operations in scenarios such as RPA tasks.

[0037] 2. The minimum region expansion algorithm of this invention can adjust the expansion area in real time according to the characteristics of dynamic elements (such as the drop-down box expansion height and the pop-up layer display position), ensuring that no matter how the elements change dynamically, they can be accurately contained within the positioning area, thus guaranteeing the accuracy of positioning. Furthermore, the minimum region expansion algorithm of this invention, through adaptive region calculation and minimum bounding box optimization, minimizes the expansion area as much as possible while ensuring that all dynamic elements are included, removing redundant space, reducing interference from irrelevant elements, and improving the efficiency of subsequent element recognition and operations.

[0038] 3. This invention dynamically calculates the expanded region, relying not on fixed pixel coordinates but on the relative position and features of elements. This ensures good positioning results across different resolutions and scaling ratios, improving the method's cross-device adaptability. This invention combines dynamic page changes with element attributes for positioning, reducing reliance on the static DOM structure. Even with changes in the page structure, positioning can still be achieved through dynamic element features and layout rules, mitigating the impact of page structure changes and improving the method's robustness. Furthermore, this invention primarily achieves positioning through dynamic detection and logical analysis of page elements, eliminating the need for complex image matching or OCR recognition. This reduces computational resource requirements, enabling efficient operation in low-configuration environments and enhancing the method's practicality. Attached Figure Description

[0039] Figure 1 This is a flowchart of the steps of the present invention;

[0040] Figure 2 This is a diagram illustrating the user's initial area selection.

[0041] Figure 3 This is a flowchart illustrating the steps involved in monitoring dynamically loaded content on a page.

[0042] Figure 4 This is a diagram illustrating an interactive dropdown menu.

[0043] Figure 5 This is a schematic diagram showing the complete display area of ​​the interactive elements;

[0044] Figure 6 Here is the flowchart of the minimum region expansion adaptive algorithm;

[0045] Figure 7 This is a schematic diagram of the minimum region expansion map. Detailed Implementation

[0046] The present invention will be further described below with reference to the accompanying drawings and embodiments, but this should not be construed as limiting the present invention.

[0047] Example: A dynamic element adaptive positioning method based on region selection, such as... Figure 1 As shown, it includes the following steps:

[0048] Step 1: Receive the initial area selected by the user through interactive operations on the page, and record the coordinate range of this initial area, such as... Figure 2 As shown; in this step, when the user performs RPA operation, he selects an initial area on the page by using the mouse or touch operation, and the RPA robot records the coordinate range of the initial area (such as the upper left corner (x1, y1) and the lower right corner (x2, y2)).

[0049] Step 2: Parse the DOM structure of the page and extract the static elements within the initial area to generate an initial element list. In this step, the complete DOM structure of the current page is obtained through the browser API. Then, starting from the root node, all DOM elements are recursively traversed. The type, position information, and attributes of each static element are collected. It is then determined whether the static element is within the initial area. If all four vertices of the static element are within the selected area, it is considered completely contained. If the static element intersects with the selected initial area, the intersection ratio is recorded. If the intersection ratio is greater than 60%, the static element is considered to be within the initial area. Finally, all static elements that meet the conditions are converted into structured data to form the initial element list.

[0050] Step 3: Using the initial element list as a reference, perform dynamic element detection on the page to obtain a set of position information for dynamic elements. In this step, the initial element list records the state of static elements within the user's selection area (including metadata such as element type, position, attributes, and DOM path). Based on this, "dynamic elements" are clearly defined as:

[0051] New elements in the time dimension: elements that were not displayed on the page when the initial selection was made (such as lazy-loaded images that were not loaded or drop-down menus that were not triggered), but were subsequently generated through user interaction or automatic loading;

[0052] Extended elements in spatial dimension: Elements that were partially displayed during the initial selection, but whose position or size exceeds the initial area due to subsequent dynamic changes (such as drop-down list expansion or pop-up window);

[0053] Elements that change in terms of attributes: Elements that already exist in the initial element list but whose subsequent attributes (such as visibility, content, number of child elements) are dynamically updated (such as table data refreshed asynchronously by AJAX).

[0054] The initial element list provides a baseline for dynamic elements; any element changes deviating from this baseline are included in the dynamic element detection scope. In this step, the dynamic element detection process includes dynamic page loading detection; the dynamic page loading detection includes:

[0055] Monitor and identify dynamically loaded content on the page. For example... Figure 3 As shown, in this embodiment, dynamically loaded content, such as paginated data and asynchronous form submission results, is identified by intercepting XMLHttpRequest (XMLHttpRequest is a JavaScript API used for asynchronous communication between a browser and a server. It allows web pages to exchange data with the server without refreshing the entire page, thereby achieving the function of dynamically updating part of the web page content.) and Fetch API (Fetch API is a modern JavaScript interface used for asynchronous requesting and retrieving of data between a browser and a server, used to achieve asynchronous communication of web pages) calls.

[0056] This embodiment tracks and identifies lazy-loaded elements triggered by scrolling on the page. The tracking and identification of lazy-loaded elements involves monitoring scroll events and using the Intersection Observer API (an asynchronous browser API used to monitor the intersection state between a target element and its ancestor elements or viewport, i.e., whether an element enters or leaves the viewport, or whether the intersection ratio changes) to detect lazy-loaded elements triggered by scrolling, such as images and table rows. When a lazy-loaded element is detected entering the viewport, a callback function is triggered. Based on the lazy-loaded element type, the corresponding resources (images, data, etc.) are loaded, the loaded resources are rendered on the page, and the element is marked as loaded, stopping the observation of the loaded element. Furthermore, during the tracking and identification of lazy-loaded elements, scroll events are throttled or debounced to avoid frequent loading, and loading time and status information are recorded for analysis and troubleshooting.

[0057] Based on page structure features, the possible location of potential dynamic content is inferred. In this embodiment, the possible location of potential dynamic content is inferred based on page structure features (such as placeholders and unrendered container elements). For example, in a product list page, a clear product list area can be seen, currently displaying only the first 6 products. At the bottom of this area are several gray placeholders with a "loading" message, and the height of the entire list area is significantly greater than the total height of the currently displayed products. Based on these features, it can be inferred that as the user scrolls down the page, more products will be loaded at the locations of these placeholders. The potential dynamic content is located below the last product, until it fills the preset height range of the entire list area. Thus, by observing structures with specific functional characteristics on the page (such as placeholder areas and reserved spaces) and combining them with common page interaction logic, the possible location of dynamic content can be predicted, thereby providing a basis for area expansion.

[0058] The step of detecting dynamic elements on the page further includes interactive element analysis; the interactive element analysis includes:

[0059] The system detects elements on the page that are bound to interactive events and predicts the child elements that may be generated after these events are triggered. In this embodiment, elements bound to interactive events include `onclick` and `onmouseover`. `onclick` is an event triggered when the user clicks (presses and releases) an element, and its application scenarios include button clicks, link navigation, form submissions, and switching element states. `onmouseover` is an event triggered when the mouse pointer moves over an element, and it is applied to mouse hover scenarios. Predicted elements that may be generated include dropdown menus, pop-ups, etc. Figure 4 As shown.

[0060] By simulating interactive behaviors (such as mouse hover and click), and combining element size and layout rules (such as CSS `position: absolute`, a positioning method used to remove an element from the normal document flow and position it relative to its nearest positioned ancestor element. If there is no positioned ancestor element, it is positioned relative to the document's initial containing block), the complete display area of ​​an interactive element can be predicted. For example, the expanded area of ​​a dropdown panel can be calculated using the width and height of its content area. Figure 5 As shown.

[0061] Step 4: Based on the set of location information of the dynamic elements, the initial region is expanded using the minimum region expansion algorithm to obtain the final expanded region.

[0062] like Figure 6 As shown, the minimum region expansion algorithm includes dynamic region expansion, adaptive region calculation, and minimum bounding box optimization;

[0063] The dynamic region expansion is used to expand the region range based on the initial selected region and the dynamic element detection results to ensure that all relevant dynamic elements are included. The steps include: for each detected dynamic element, determining its spatial relationship with the initial selected region; if the dynamic element is completely within the selected region, no expansion is needed; if the dynamic element is partially or completely outside the selected region, it is included in the expansion calculation range; calculating the minimum rectangular region to be expanded, such that the minimum rectangular region includes the initial selected region and all relevant dynamic elements.

[0064] The adaptive region calculation is used to determine the boundary of the expanded region by combining the characteristics of different types of dynamic elements based on the dynamic region expansion, thereby achieving a balance between full coverage of dynamic elements and region minimization. The steps include: classifying and processing according to the type of dynamic elements on the page: for dropdown boxes, calculating their maximum height after expansion and expanding the region vertically by the maximum height in pixels; for pop-up layers, obtaining the pop-up layer's hierarchy information and calculating its display position and size; for dynamically loaded content, estimating the size of its displayed area after loading.

[0065] Construct the boundary calculation function for the extended region: Here, R represents a rectangular region, and di represents a dynamic element. This function finds the rectangular region with the smallest area among all rectangular regions R that can contain all dynamic elements di in the set of dynamic elements D, and uses this as the final expansion region.

[0066] The minimum bounding box optimization is used to balance the expanded region by minimizing the region and eliminating redundant space. The steps include:

[0067] Calculate the bounding rectangle of all dynamic elements that need to be included, and remove redundant space;

[0068] Applying boundary constraints, the horizontal expansion range is [x1-△x, x2+△x], and the vertical expansion range is [y1-△y, y2+△y], where △x and △y are dynamically calculated expansion values;

[0069] Output the final expanded region coordinates to obtain the final expanded region, such as... Figure 7 As shown.

[0070] The following example, using an "e-commerce order page," illustrates how to expand an initial region using a minimum region expansion algorithm based on a set of dynamic element location information to obtain the final expanded region:

[0071] Scenario: On the e-commerce order page, the user selects the "Pending Payment Orders" button (initial area), but clicking the button will trigger two dynamic elements: a drop-down menu (containing "Unpaid" and "Cancelled" sub-items) and a floating prompt box (displaying "Click to view details").

[0072] Therefore, a minimum region expansion algorithm is needed to ensure that the expanded region includes the initial button and the two dynamic elements, while avoiding over-expansion. The process is as follows:

[0073] 1. Determine the initial region and the set of dynamic element positions;

[0074] Initial selection area: The "Pending Payment Orders" button selected by the user, with coordinates (x1=300, y1=150, x2=450, y2=200) (top left to bottom right).

[0075] Dynamic element position set D:

[0076] Dynamic element 1 (drop-down menu): When expanded, its coordinates are (x=280, y=200, x2=470, y2=350) (slightly wider than the button, contains 3 sub-items, and has a height of 150px).

[0077] Dynamic element 2 (floating tooltip): After being triggered, its coordinates are (x=460, y=180, x2=560, y2=220) (located to the right of the button, with a width of 100px and a height of 40px).

[0078] 2. Dynamic Region Expansion: Determine spatial relationships and include them within the expansion range;

[0079] Determine the relationship between each dynamic element and the initial region:

[0080] Dynamic element 1 (drop-down menu): The top is aligned with the bottom of the initial area (y=200), but the whole is located below the initial area, and the left side (280<300) and right side (470>450) exceed the initial area. It belongs to "partially located outside the area" and needs to be included in the expansion.

[0081] Dynamic element 2 (floating tooltip): It is located entirely to the right of the initial area (x=460>450), which is "completely outside the area" and needs to be included in the expansion.

[0082] Initial expansion objective: Calculate the smallest rectangle containing the initial region plus two dynamic elements.

[0083] 3. Adaptive region calculation: Adjust the expansion strategy based on element type;

[0084] For dropdown menus: the vertical direction needs to be expanded to its maximum height (150px), so the bottom of the initial area (y2=200) needs to be expanded downward by 150px to y=200+150=350.

[0085] For floating tooltips (popup type): the horizontal direction needs to be extended to its right boundary (x2=560), and since the height of the tooltips (40px) is relatively narrow, no additional vertical extension is required.

[0086] Initial expansion region: (x=280, y=150, x2=560, y2=350).

[0087] The result contains complete positional information of the initial region and the two dynamic elements, and combines features such as the maximum height of the drop-down menu and the display position of the floating tooltip to ensure full coverage of the dynamic elements. This is the input data for minimum bounding box optimization.

[0088] 4. Minimum bounding box optimization: Remove redundancy and apply constraints;

[0089] Calculate the bounding rectangle: The minimum bounding rectangle of all elements (initial button + two dynamic elements) is:

[0090] Left = 280 (left side of dynamic element 1), top = 150 (top of initial area), right = 560 (right side of dynamic element 2), bottom = 350 (bottom of dynamic element 1).

[0091] Remove redundant space: Check for unnecessary blank areas (such as gaps between dynamic elements). The space between the two dynamic elements here is not redundant and does not need to be reduced. Apply boundary constraints: Horizontal expansion △x = 560 - 450 = 110px (distance from the initial right boundary to the right boundary of the tooltip), vertical expansion △y = 350 - 200 = 150px (distance from the initial bottom boundary to the bottom of the drop-down menu). The constraint range conforms to [x1 - △x, x2 + △x] and [y1 - △y, y2 + △y].

[0092] 5. Output the coordinates of the final expanded region:

[0093] The final expanded region is (x1'=280, y1'=150, x2'=560, y2'=350). This is consistent with the initial expanded region calculated by the adaptive region algorithm.

[0094] This completes the entire minimum region expansion algorithm process. This minimum region fully encompasses the initial button, dropdown menu, and floating tooltip, ensuring that RPA can recognize and manipulate all dynamic elements without over-expanding (e.g., not expanding left to the page edge, not expanding upwards to the irrelevant "navigation bar"), thus avoiding the introduction of interfering elements. Through this process, the minimum region expansion algorithm achieves the goal of "precisely covering dynamic elements + minimizing the region range."

[0095] In summary, this invention, by combining dynamic page changes, enables the automatic expansion of the user's selection area, ensuring that RPA can comprehensively and accurately identify and manipulate all operable elements.

Claims

1. A dynamic element adaptive positioning method based on region selection, characterized in that, Includes the following steps: Step 1: Receive the initial area of ​​the page selected by the user through interactive operation, and record the coordinate range of the initial area; Step 2: Parse the DOM structure of the page and extract the static elements in the initial area to generate an initial element list; Step 3: Using the initial element list as a reference, perform dynamic element detection on the page to obtain a set of dynamic element position information; Step 4: Based on the set of location information of the dynamic elements, the initial region is expanded using the minimum region expansion algorithm to obtain the final expanded region; The minimum region expansion algorithm includes dynamic region expansion, adaptive region calculation, and minimum bounding box optimization. The dynamic region expansion is used to expand the region range based on the initial selected region and the dynamic element detection results, so as to ensure that all relevant dynamic elements are included. The dynamic region expansion step includes: For each detected dynamic element, determine its spatial relationship with the initial selection area. If the dynamic element is completely within the selection area, no expansion is needed; if the dynamic element is partially or completely outside the selection area, include it in the expansion calculation. Calculate the minimum rectangular area that needs to be expanded, such that the minimum rectangular area includes the initial selected area and all related dynamic elements; The adaptive region calculation is used to process the characteristics of different types of dynamic elements based on dynamic region expansion, thereby determining the boundary of the expanded region and achieving a balance between full coverage of dynamic elements and region minimization; the adaptive region calculation steps include: The processing is categorized based on the type of dynamic elements on the page: For dropdown lists, calculate their maximum height after expansion and expand the area vertically by the maximum height in pixels; for pop-up layers, obtain the pop-up layer's hierarchy information and calculate its display position and size; for dynamically loaded content, estimate the size of its display area after loading. Construct the boundary calculation function for the extended region: R_extended=min {R|∀di∈D,di⊂R}, where R represents the rectangular region and di represents the dynamic element; The minimum bounding box optimization is used to balance the expanded region by minimizing the region and eliminating redundant space; the minimum bounding box optimization steps include: Calculate the bounding rectangle of all dynamic elements that need to be included, and remove redundant space; Applying boundary constraints, the horizontal expansion range is [x1-△x, x2+△x], and the vertical expansion range is [y1-△y, y2+△y], where △x and △y are dynamically calculated expansion values, x1 is the x-coordinate of the upper left corner of the initial region, x2 is the x-coordinate of the lower right corner of the initial region, y1 is the y-coordinate of the upper left corner of the initial region, and y2 is the y-coordinate of the lower right corner of the initial region. Output the final coordinates of the expanded region.

2. The dynamic element adaptive positioning method based on region selection according to claim 1, characterized in that, The coordinate range includes the coordinates of the top left corner (x1, y1) and the bottom right corner (x2, y2) of the initial region; the initial element list includes element type, position and attribute.

3. The dynamic element adaptive positioning method based on region selection according to claim 1, characterized in that, The step of performing dynamic element detection on the page includes dynamic page loading detection; the dynamic page loading detection includes: Listen for and identify dynamically loaded content on the page; Track and identify lazy-loaded elements on the page that are triggered by scrolling. Based on page structure features, the possible locations of potential dynamic content are inferred.

4. The dynamic element adaptive positioning method based on region selection according to claim 3, characterized in that, The process of tracking and identifying lazy-loaded elements triggered by scrolling on the page is as follows: Listen for scroll events, detect whether lazy-loaded elements have entered the viewport, and trigger a callback function after they enter the viewport; Load the corresponding resources according to the lazy-loaded element type, render the loaded resources to the page, mark the element as loaded, and stop observing the loaded element.

5. The dynamic element adaptive positioning method based on region selection according to claim 4, characterized in that, During the tracking and identification of lazy-loaded elements, scroll events are throttled or debounced to avoid frequent loading, while loading time and status information are recorded for analysis and troubleshooting.

6. The dynamic element adaptive positioning method based on region selection according to claim 1, characterized in that, The step of detecting dynamic elements on the page further includes interactive element analysis; the interactive element analysis includes: Detect elements on the page that are bound to interactive events, and predict the child elements that may be generated after the events are triggered; By simulating interactive behavior and combining element size and layout rules, the complete display area of ​​interactive elements can be predicted.

Citation Information

Patent Citations

  • Page interaction method, device and terminal

    CN103399706A

  • Webpage dynamic element pickup method and system based on RPA

    CN120524019A