Webpage detection processing method and device

By obtaining the web page address, calling the driver tool to load the web page resource data, and using the web page detection engine to perform adaptation detection in a specific access mode, identifying and correcting abnormal elements, it solves the problem that web pages in the prior art are difficult to meet the needs of diverse users. Improves user experience and web adaptability.

CN118916559APending Publication Date: 2024-11-08ANT BLOCKCHAIN TECHNOLOGY (SHANGHAI) CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411053815.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-01
Publication Date
2024-11-08

AI Technical Summary

Technical Problem

The prior art is difficult to effectively process web pages to meet the needs of diverse users, especially for users with physiological decline, physiological defects and physiological disorders, resulting in poor user experience.

Method used

By obtaining the web page address, calling the driver tool to load the web page resource data, converting it into web page code, and using the web page detection engine to perform adaptation detection in a specific access mode, identifying adaptation abnormal elements, and generating detection results to improve the adaptability of the web page and user experience.

Benefits of technology

It realizes adaptive detection of web pages, identify and correct abnormal elements, improves web page adaptability and user experience in specific user access modes, and enhances the comprehensiveness of web pages and the developer's perception.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118916559A_ABST
    Figure CN118916559A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a webpage detection processing method and device.The webpage detection processing method comprises the steps that after a webpage address of a webpage to be detected is obtained, a driving tool is called to conduct webpage loading based on the webpage address to obtain webpage resource data, and webpage codes obtained by conducting conversion processing on the webpage resource data are obtained; the method comprises the following steps: performing adaptation detection of at least one detection dimension in a specific access mode on a webpage code through a webpage detection engine to obtain an adaptation abnormal element of a to-be-detected webpage, and on the basis, performing code identification on the webpage code by means of the adaptation abnormal element of the to-be-detected webpage to obtain a code snippet; and generating a detection result of the to-be-detected webpage in combination with the code snippets and the adaptive abnormal elements.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This document relates to the field of data processing technology, and in particular to a web page detection and processing method and device. Background Art

[0002] With the continuous development and promotion of Internet technology, the application scope of online services provided by browsers is becoming wider and wider. Various forms of web pages providing services have emerged, and the types and forms of services provided by web pages have become more and more diverse, which has led to more and more users participating in the online services provided by web pages. However, users also have special needs for web pages that provide online services. In this case, how to process web pages so that the web pages that provide online services meet the diverse needs of users has become a focus of attention for web page providers. Summary of the invention

[0003] One or more embodiments of the present specification provide a web page detection and processing method, including: obtaining a web page address of a web page to be detected. Calling a driving tool to load a web page based on the web page address to obtain web page resource data, and obtaining a web page code obtained by converting the web page resource data. Inputting the web page code into a web page detection engine to perform adaptation detection of at least one detection dimension under a specific access mode, and obtaining an adaptation exception element of the web page to be detected. According to the adaptation exception element, code identification is performed in the web page code to obtain a code snippet, and based on the adaptation exception element and the code snippet, a detection result of adaptation detection of the web page to be detected is generated.

[0004] One or more embodiments of the present specification provide a web page detection and processing device, including: a web page address acquisition module, configured to obtain the web page address of a web page to be detected. A web page loading module, configured to call a driving tool to load a web page based on the web page address to obtain web page resource data, and obtain a web page code obtained by converting the web page resource data. An adaptation detection module, configured to input the web page code into a web page detection engine to perform adaptation detection of at least one detection dimension under a specific access mode, and obtain an adaptation exception element of the web page to be detected. A code recognition module, configured to perform code recognition in the web page code according to the adaptation exception element to obtain a code snippet, and generate a detection result of adaptation detection of the web page to be detected based on the adaptation exception element and the code snippet.

[0005] One or more embodiments of the present specification provide a web page detection and processing device, including: a processor; and a memory configured to store computer executable instructions, wherein when the computer executable instructions are executed, the processor: obtains the web page address of a web page to be detected. Calls a driver tool to load a web page based on the web page address to obtain web page resource data, and obtains a web page code obtained by converting the web page resource data. The web page code is input into a web page detection engine to perform adaptation detection of at least one detection dimension under a specific access mode, and an adaptation exception element of the web page to be detected is obtained. Code identification is performed in the web page code according to the adaptation exception element to obtain a code snippet, and based on the adaptation exception element and the code snippet, a detection result of adaptation detection of the web page to be detected is generated.

[0006] One or more embodiments of the present specification provide a computer-readable storage medium for storing computer-executable instructions, which implement the following steps when executed: obtaining the web page address of the web page to be detected. Calling a driver tool to load a web page based on the web page address to obtain web page resource data, and obtaining a web page code obtained by converting the web page resource data. Inputting the web page code into a web page detection engine to perform adaptation detection of at least one detection dimension under a specific access mode, and obtaining an adaptation exception element of the web page to be detected. According to the adaptation exception element, code identification is performed in the web page code to obtain a code snippet, and based on the adaptation exception element and the code snippet, a detection result of the adaptation detection of the web page to be detected is generated. BRIEF DESCRIPTION OF THE DRAWINGS

[0007] In order to more clearly illustrate one or more embodiments of the present specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present specification. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative labor.

[0008] Figure 1 A schematic diagram of an implementation environment of a web page detection and processing method provided by one or more embodiments of this specification;

[0009] Figure 2 A processing flow chart of a web page detection processing method provided by one or more embodiments of this specification;

[0010] Figure 3 A processing flow chart of a web page detection processing method applied to a web page adaptation detection scenario provided by one or more embodiments of this specification;

[0011] Figure 4 A schematic diagram of an embodiment of a web page detection and processing device provided by one or more embodiments of this specification;

[0012] Figure 5 A schematic diagram of the structure of a web page detection and processing device provided in one or more embodiments of this specification. DETAILED DESCRIPTION

[0013] In order to enable those skilled in the art to better understand the technical solutions in one or more embodiments of this specification, the technical solutions in one or more embodiments of this specification will be clearly and completely described below in conjunction with the drawings in one or more embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of them. Based on one or more embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this document.

[0014] The web page detection processing method provided in one or more embodiments of this specification can be applied to the implementation environment of web page detection. Figure 1 , the implementation environment at least includes:

[0015] A web page detection system 101 for performing web page detection processing, a driver tool 102 and a web page detection engine 103 deployed by the web page detection system 101, and in addition, the implementation environment may also include a third-party system 104, and the third-party system 104 may be a system of a party to which the web page to be detected belongs; wherein the web page detection system 101 may run on a server, and the server may be one or more servers, a server cluster composed of several servers, or a cloud server of a cloud computing platform;

[0016] In this implementation environment, after obtaining the web page address of the web page to be detected, the web page detection system 101 calls the driving tool 102 to load the web page based on the web page address, obtains the web page resource data of the web page to be detected, and obtains the web page code obtained by converting the web page resource data. The web page detection engine 103 performs adaptation detection of at least one detection dimension under a specific access mode on the web page code to obtain the adaptation abnormality element of the web page to be detected. On this basis, the code fragments in the web page code are identified with the help of the adaptation abnormality element of the web page to be detected, and the detection result of the adaptation detection of the web page to be detected is generated in combination with the adaptation abnormality element and the code fragment;

[0017] The third-party system 104 may submit the web page address of the web page to be detected to the web page detection system 101 ; the third-party system 104 may obtain the detection result of the adaptation detection on the web page to be detected from the web page detection system 101 as needed.

[0018] One or more embodiments of a web page detection and processing method provided in this specification are as follows:

[0019] Reference Figure 2 The web page detection and processing method provided in this embodiment specifically includes steps S202 to S208.

[0020] Step S202, obtaining the webpage address of the webpage to be detected.

[0021] The web page to be detected in this embodiment refers to a web page to be detected for adaptation detection of a specific access mode, and the web page to be detected includes an application page of a web application. The web page to be detected in this embodiment can be a web page to be detected of any web application, that is, a web page to be detected of any web application with detection requirements; this embodiment does not specifically limit the type of web page to be detected, for example, the web page to be detected can be a web page to be detected, an H5 page, and in addition, the web page to be detected can also be other types of web pages.

[0022] The web page address of the web page to be detected includes the web page address for adaptation detection of the specific access mode of the web page to be detected, for example, the web page address can be a URL (Uniform Resource Locator), and the web page address can be used for adaptation detection of the specific access mode of the web page to be detected; the specific access mode includes a specific user access mode, that is, a mode provided to a specific user for access, and the specific user here includes a physiological decline user, a physiological defect user and / or a physiological disorder user. The physiological decline user can be an elderly user, in which case, the specific access mode can be an elderly mode. This embodiment can be applied to a web page detection system. Optionally, the web page address of the web page to be detected includes the page address of an application page of a web application. The web page to be detected can be one or more, and the web page address of the web page to be detected can also be one or more.

[0023] In specific implementation, on the one hand, a third party can directly submit the web address of the web page to be detected to the web page detection system, and the third party refers to the party to which the web page to be detected belongs; on the other hand, the detection personnel can also input the web address of the web page to be detected through the web address management module and submit it to the web page detection system, that is, optionally, the web address of the web page to be detected is input through the web address management module and submitted to the web page detection system; the web address management system refers to the visual input of the web address of the web page to be detected and submitting it to the web page detection system to perform adaptation detection on the specific access mode of the web page to be detected.

[0024] In actual applications, although the web page address of the web page to be detected may be single, there is a need to perform batch web page detection. In this case, in order to meet the diverse needs of web page detection, the detection type of the web page detection can be obtained while obtaining the web page address of the web page to be detected. The detection type here includes a single web page detection type or multiple web page detection types; step S204 can be executed when the detection type is a single web page detection type.

[0025] It should be supplemented that the above step S202 can be replaced by obtaining the webpage address of the webpage to be detected in a specific access mode, and form a new implementation method with other processing steps provided in this embodiment.

[0026] Step S204: calling a driving tool to load a web page based on the web page address to obtain web page resource data, and obtaining a web page code obtained by converting the web page resource data.

[0027] After obtaining the web address of the web page to be detected as mentioned above, in this step, the driver tool is called to load the web page based on the web address to obtain the web page resource data, and the web page code obtained by converting the web page resource data is obtained, so as to realize the dynamic acquisition of the detection data for adaptation detection through web page loading, thereby improving the detection effectiveness of adaptation detection.

[0028] The driving tool in this embodiment may be a browser driving tool, or an automated testing tool for web applications, and the driving tool may specifically be webDriver. The webpage resource data may include DOM (Document Object Model) structure data of the webpage to be detected, and the webpage resource data may specifically be a DOM tree of the webpage to be detected. The webpage code may include the webpage source code of the webpage to be detected.

[0029] In actual applications, in the process of adapting and detecting the web page to be detected, there may be no need for visually displaying the web page to be detected, that is, there is no need for interface interaction for the web page to be detected. In view of this, in order to simplify the detection process of adapting and detecting the web page to be detected and avoid waste of resources caused by visually displaying the web page; in an optional implementation manner provided by this embodiment, in the process of calling the driver tool to load the web page based on the web page address to obtain web page resource data, and obtaining the web page code obtained by converting the web page resource data, the following operations are performed:

[0030] Calling the driving tool to load a web page in a browser based on the web page address to obtain DOM structure data of the web page to be detected;

[0031] The web page code is obtained by converting the DOM structure data into code through the driving tool.

[0032] Wherein, the browser may be a headless browser. The code conversion here may be a string conversion, that is, converting DOM structure data into web page code in string form.

[0033] Specifically, the driving tool can be called to load the web page to be detected corresponding to the web page address in the headless browser to obtain the DOM structure data of the web page to be detected. In this case, since the DOM structure data of the web page to be detected is stored in the headless browser, the driving tool can also be called to obtain the web page code obtained by converting the DOM structure data from the headless browser.

[0034] It is mentioned above that in this embodiment, there may be a demand for multiple web page detections, that is, a demand for batch web page detection. When the web page address of the web page to be detected is obtained, the detection type of the web page detection can also be obtained. When the detection type is a single web page detection type, step S204 is executed; when the detection type is a multiple web page detection type, in the process of obtaining web page resource data by loading the web page based on the web page address, the corresponding web page can be loaded in a headless browser based on the web page address to obtain the web page resource data of the web page to be detected, and web page simulation interaction can be performed based on the web page resource data of the web page to be detected to obtain the web page resource data of multiple web pages to be detected. In this case, the subsequent web pages to be detected may be multiple web pages to be detected.

[0035] Step S206: input the web page code into a web page detection engine to perform adaptation detection of at least one detection dimension under a specific access mode, and obtain adaptation abnormal elements of the web page to be detected.

[0036] The above-mentioned calling driving tool loads the web page based on the web page address to obtain the web page resource data, and obtains the web page code obtained by converting the web page resource data. In this step, the web page code is input into the web page detection engine to perform adaptation detection on the web page code in at least one detection dimension under a specific access mode, and obtain the adaptation abnormal elements of the web page to be detected. In this case, since the original web page data such as the web page code has relatively comprehensive relevant data of the web page to be detected, the adaptation detection of the web page to be detected in a specific access mode is performed on the web page code to improve the comprehensiveness and effectiveness of the adaptation detection of the web page to be detected.

[0037] The web page detection engine described in this embodiment refers to a detection engine that performs adaptive detection of at least one detection dimension under a specific access mode on the web page to be detected; the web page detection engine may be a JS (JavaScript) detection engine.

[0038] The specific access mode refers to a mode provided to a specific user for access, i.e., a specific user access mode, for example, the specific user includes a physiological decline user, a physiological defect user and / or a physiological disorder user, and the physiological decline user may be an elderly user. The at least one detection dimension refers to one or more detection dimensions for adaptation detection, and optionally, the detection dimension includes at least one of the following: text font detection dimension, text color detection dimension, web page layout detection dimension, and focus area detection dimension.

[0039] The adaptation detection described in this embodiment includes detecting whether the web page to be detected meets the preset access parameters of at least one detection dimension under a specific access mode; the preset access parameters refer to the access parameters of each detection dimension of the pre-set specific access mode; the text font detection dimension includes the detection dimension of performing adaptation detection of the text font in the web page to be detected in a specific access mode; the text color detection dimension includes the detection dimension of performing adaptation detection of the text color in the web page to be detected in a specific access mode; the web page layout detection dimension includes the detection dimension of performing adaptation detection of the web page layout in the web page to be detected in a specific access mode, for example, the web page layout may be line spacing, paragraph spacing, number of lines, etc.; the focus area detection dimension includes the detection dimension of performing adaptation detection of the focus area in the web page to be detected in a specific access mode.

[0040] The adapted abnormal elements of the web page to be detected include abnormal web page elements in the web page to be detected obtained after the web page to be detected is adapted and detected in at least one detection dimension under a specific access mode through the web page code, that is, web page elements in the web page to be detected that are not compatible with the preset access parameters of at least one detection dimension of the specific access mode. For example, the adapted abnormal elements of the web page to be detected include abnormal text fonts, abnormal text colors, abnormal web page layouts and / or abnormal focus areas in the web page to be detected; the web page elements here include text fonts corresponding to the text font detection dimension, text colors corresponding to the text color detection dimension, web page layouts corresponding to the web page layout detection dimension and / or focus areas corresponding to the focus area detection dimension.

[0041] In specific implementation, the above-mentioned calling driving tool obtains the web page code obtained by converting the web page resource data. Here, the web page code can be input into the web page detection engine through the driving tool to perform adaptation detection of at least one detection dimension under a specific access mode, and obtain the adaptation abnormal element of the web page to be detected; in an optional implementation manner provided by this embodiment, the adaptation detection of any detection dimension in the at least one detection dimension is implemented in the following manner:

[0042] Parsing the webpage code, and extracting element attribute parameters corresponding to any detection dimension from the code parsing result;

[0043] Compare the element attribute parameter with a preset access parameter of any detection dimension in the specific access mode;

[0044] If the comparison result is inconsistent, determining that the web page element corresponding to the element attribute parameter is an abnormal adaptation element;

[0045] If the comparison result is consistent, no processing is required.

[0046] Among them, the element attribute parameters corresponding to any detection dimension refer to the attribute parameters of the web page elements, and the element attribute parameters corresponding to any detection dimension include the attribute parameters of the web page elements of the web page to be detected in any detection dimension. For example, if any detection dimension is a text font detection dimension, the element attribute parameters corresponding to any detection dimension are the font parameters of the text font in the web page to be detected. The preset access parameters of any detection dimension refer to the preset access parameters of any detection dimension under a pre-set specific access mode. For example, if any detection dimension is a text font detection dimension, the preset access parameters of any detection dimension are the preset font parameters of the text font detection dimension under the elderly mode.

[0047] Step S208: performing code identification in the webpage code according to the abnormal adaptation element to obtain a code snippet, and generating a detection result of performing adaptation detection on the webpage to be detected based on the abnormal adaptation element and the code snippet.

[0048] The above-mentioned web page detection engine performs adaptation detection on the web page code under a specific access mode in at least one detection dimension to obtain the adaptation exception element of the web page to be detected. In this step, in order to achieve comprehensiveness of the adaptation detection of the web page to be detected, code identification is performed in the web page code according to the adaptation exception element to obtain a code snippet, and a detection result of the adaptation detection of the web page to be detected is generated based on the adaptation exception element and the code snippet, so as to improve the perception of the developer of the web page code by identifying the code snippet corresponding to the adaptation exception element in the web page code.

[0049] The code snippet described in this embodiment includes an abnormal code snippet, that is, an abnormal code snippet corresponding to an abnormal adaptation element in the webpage code. For example, if the abnormal adaptation element is an abnormal text font, the code snippet is an abnormal code snippet corresponding to the abnormal text font in the webpage code.

[0050] In actual applications, the distribution of the abnormal adaptation elements of the web page to be detected may be chaotic. For example, the abnormal adaptation elements of the web page to be detected are abnormal text fonts, abnormal text colors, and abnormal text fonts. In this case, in order to improve the distribution clarity of the abnormal adaptation elements of the web page to be detected, in an optional implementation manner provided by this embodiment, in the process of obtaining code snippets by performing code recognition in the web page code according to the abnormal adaptation elements, the following operations are performed:

[0051] Clustering the abnormal adaptation elements of the web page to be detected according to the detection dimension to obtain clustered abnormal elements;

[0052] Abnormal code identification is performed on the webpage code according to the clustered abnormal elements to obtain abnormal code fragments.

[0053] The clustering process includes clustering together the abnormal adaptation elements corresponding to the same detection dimension among the abnormal adaptation elements of the web page to be detected.

[0054] Continuing with the above example, the first abnormal adaptation element of the web page to be detected is an abnormal text font, the second is an abnormal text color, and the third is an abnormal text font. The abnormal adaptation elements of the web page to be detected are clustered according to the detection dimension, and the clustered abnormal elements are obtained as the first abnormal text font, the second is an abnormal text font, and the third is an abnormal text color. The web page code is identified for abnormal code based on the clustered abnormal elements to obtain abnormal code fragments. The abnormal adaptation elements of the same detection dimension in the abnormal adaptation elements of the web page to be detected are clustered together through clustering, which can improve the intuitive neatness of the clustered abnormal elements.

[0055] On this basis, there may be a need to provide a correction code snippet for the abnormal code snippet. In view of this, in order to improve the comprehensiveness of the detection result of the adaptation detection of the web page to be detected and improve the experience of the party to whom the web page to be detected belongs; in the first optional implementation mode provided by this embodiment, in the process of generating the detection result of the adaptation detection of the web page to be detected based on the adaptation abnormal element and the code snippet, the following operations are performed:

[0056] Inputting the clustered abnormal elements and the abnormal code fragments into a code correction component for code correction processing to obtain a corrected code fragment corresponding to the abnormal code fragment;

[0057] A detection document for performing adaptation detection on the web page to be detected is generated according to the clustered abnormal elements, the abnormal code fragments and the corrected code fragments.

[0058] Optionally, the code correction process includes performing code correction process under a specific access mode, and the correction code fragment corresponding to the abnormal code fragment includes a code fragment obtained by optimizing the abnormal code fragment under a specific access mode, so that the correction code fragment can adapt to the specific access mode, so that the web page obtained by executing the corrected web page code in the actual scenario is adapted to the specific access mode, thereby improving the access experience of specific users and improving the user retention rate of the web application. The detection document can be a detection report.

[0059] In a specific implementation, in order to improve the intuitiveness of the owner of the web page to be detected for viewing the abnormal adaptation elements and code snippets, that is, to enable the owner to view the abnormal adaptation elements and code snippets more intuitively, thereby improving the convenience of the owner to optimize the web page code of the web page to be detected; in the second optional implementation mode provided by this embodiment, in the process of generating the detection result of the adaptation detection of the web page to be detected based on the abnormal adaptation elements and the code snippets, the following operations are performed:

[0060] Performing interaction interface configuration on the adaptation abnormal element to obtain an interaction abnormal element;

[0061] The position information of the code snippet in the webpage code is associated with the abnormal interaction element, and the associated abnormal interaction element is used as the detection result.

[0062] Among them, the interaction abnormal element refers to the adaptation abnormal element after the interaction interface is configured, that is, the adaptation abnormal element configured with the interaction interface; the interaction interface refers to the interface used for interaction; the interaction abnormal element can be in a triggerable state; the position information includes the start and end position information of the code fragment in the web page code, such as the position information is from the y1th character in the x1th line to the y2th character in the x2th line.

[0063] On this basis, in an optional implementation manner provided by this embodiment, after associating the position information of the code snippet in the webpage code with the abnormal interaction element and executing the associated abnormal interaction element as the detection result, the following operation is further performed:

[0064] If the associated abnormal interaction element is triggered, a code segment corresponding to the position information in the webpage code is marked.

[0065] Specifically, if the associated abnormal interaction element is triggered, the code fragment corresponding to the position information can be marked in the web page code according to the marking element information; wherein the marking element information includes marking color information, such as highlight color information.

[0066] In addition, based on the above-mentioned associating the position information of the code fragment in the web page code to the interaction abnormal element and taking the associated interaction abnormal element as the detection result, if the associated interaction abnormal element is triggered, the following operation can be performed: marking the code fragment corresponding to the position information in the web page code.

[0067] During the specific execution process, after generating the detection result of the adaptation detection of the web page to be detected, the third party can use the web page address as the interface call input, call the download interface to download the detection result to obtain the detection result, so that the third party can download the detection result at any time as needed, thereby improving the convenience and flexibility of the third party in obtaining the detection result; the third party here refers to the party to which the web page to be detected belongs.

[0068] In actual applications, in the process of obtaining the detection result of the adaptation detection of the web page to be detected, the third party may have the need to push relevant information to the third party at the same time, so as to realize the marketing of the pushed information and improve the retention rate of the third party performing the web page detection at the same time; after the code is identified in the web page code according to the adaptation abnormal element to obtain the code fragment, and the detection result of the adaptation detection of the web page to be detected is generated based on the adaptation abnormal element and the code fragment, the following operations may also be performed:

[0069] Storing the test results in a test database;

[0070] If a target webpage address passed in by the interface call is detected, querying the detection result corresponding to the target webpage address from the detection database based on the target webpage address;

[0071] The queried detection results and the push information of the voice broadcast component and / or the push information of the text access auxiliary component are transmitted back.

[0072] Among them, the voice broadcast component includes a TTS (Text To Speech) voice component; the text access auxiliary component can be a magnifying glass; the push information of the voice broadcast component refers to the information pushed to the voice broadcast component, and the push information of the text access auxiliary component refers to the information pushed to the text access auxiliary component.

[0073] This embodiment stores the detection results in a detection database, so that a third party can flexibly obtain the detection results corresponding to the target web page address from the detection database as needed in the future, and realizes the marketing of the voice broadcast component and / or the text access auxiliary component by pushing the voice broadcast component and / or the text access auxiliary component.

[0074] In addition, when the target web page address passed in by the interface call is detected, the present embodiment can directly query the detection result corresponding to the target web page address from the detection database based on the target web page address, and transmit back the queried detection result and the push information of the voice broadcast component and / or the push information of the text access auxiliary component.

[0075] It should be supplemented that, each optional implementation mode in step S202 to step S208 provided in this embodiment can be executed independently as needed, or can be combined and referenced to each other. At the same time, each specific execution step in each optional implementation mode can be executed independently or in combination, and this embodiment does not make specific limitations.

[0076] In summary, the one or more web page detection and processing methods provided in the present embodiment include, firstly, obtaining the web page address of the web page to be detected, calling a driving tool to load the web page in the browser based on the web page address, obtaining the DOM structure data of the web page to be detected, and obtaining the web page code obtained by code conversion of the DOM structure data through the driving tool; secondly, inputting the web page code into the web page detection engine to perform adaptation detection of at least one detection dimension under a specific user access mode, and obtaining the adaptation abnormal element of the web page to be detected, so as to perform adaptation detection on the web page to be detected by using the web page code, which contains relatively comprehensive relevant information of the web page to be detected, so as to improve the accuracy of the adaptation detection of the web page to be detected, and at the same time, by performing adaptation detection under a specific user access mode, the adaptability of the web page to be detected and the specific user is enhanced, and the user experience of the specific user in the process of accessing the web page is improved, and the comprehensiveness of the adaptation detection of the web page to be detected is ensured through the adaptation detection of each detection dimension;

[0077] Finally, the adaptation abnormal elements of the web page to be detected are clustered according to the detection dimension to obtain the clustered abnormal elements, the abnormal code of the web page code is identified according to the clustered abnormal elements to obtain the abnormal code fragment, the clustered abnormal elements and the abnormal code fragment are input into the code correction component for code correction processing to obtain the correction code fragment corresponding to the abnormal code fragment, and the detection document for adaptation detection of the web page to be detected is generated according to the clustered abnormal elements, the abnormal code fragment and the correction code fragment, so as to improve the distribution clarity of the adaptation abnormal elements of the web page to be detected in the subsequent detection documents by clustering the adaptation abnormal elements, and improve the detection accuracy of the web page to be detected by introducing code correction to obtain the correction code fragment. The comprehensiveness of the document is tested, or abnormal code is identified in the web page code according to the adapted abnormal element to obtain an abnormal code fragment, an interactive interface is configured for the adapted abnormal element to obtain an interactive abnormal element, the start and end position information of the abnormal code fragment in the web page code is associated with the interactive abnormal element, and the associated interactive abnormal element is obtained; if the associated interactive abnormal element is triggered, the abnormal code fragment corresponding to the start and end position information in the web page code is marked, so that the interactive abnormal element is in a triggerable state through the interactive interface configuration, and the corresponding abnormal code fragment is marked after the interactive abnormal element is triggered, so as to improve the intuitiveness of the abnormal code fragment, and then facilitate the optimization and adjustment of the web page code.

[0078] The following takes the application of a web page detection processing method provided by this embodiment in a web page adaptation detection scenario as an example to further illustrate the web page detection processing method provided by this embodiment. Figure 3 , a web page detection processing method applied to a web page adaptation detection scenario specifically includes the following steps.

[0079] Step S302, obtaining the webpage address of the webpage to be detected in the elderly mode.

[0080] The elderly mode here refers to a mode provided for elderly users to access; the elderly mode here can also be a physiological defect user mode, a physiological decline user mode or a physiological disorder user mode.

[0081] Step S304, calling webDriver to load a web page based on the web page address in the headless browser, and obtaining DOM structure data of the web page to be detected.

[0082] Step S306, obtaining the web page code obtained by transcoding the DOM structure data through webDriver, and inputting the web page code into the web page detection engine.

[0083] Step S308: Perform adaptation detection of at least one detection dimension in the elderly mode on the web page code through the web page detection engine to obtain adaptation abnormal elements of the web page to be detected.

[0084] Optionally, the detection dimension includes at least one of the following: text font detection dimension, text color detection dimension, web page layout detection dimension, and focus area detection dimension.

[0085] Step S310: clustering the abnormal adaptation elements of the web page to be detected according to the detection dimension to obtain clustered abnormal elements.

[0086] Step S312: performing abnormal code identification on the webpage code according to the clustered abnormal elements to obtain abnormal code fragments.

[0087] Step S314: input the clustered abnormal elements and abnormal code snippets into a code correction component for code correction processing to obtain a corrected code snippet corresponding to the abnormal code snippet.

[0088] Step S316: generating a detection document for performing adaptation detection on the web page to be detected based on the clustered abnormal elements, abnormal code snippets and corrected code snippets.

[0089] It should be added that the above steps S310 to S316 can be replaced by identifying the abnormal code in the web page code according to the adaptation abnormal element to obtain the abnormal code fragment, configuring the interactive interface for the adaptation abnormal element to obtain the interactive abnormal element, associating the position information of the abnormal code fragment in the web page code with the interactive abnormal element to obtain the associated interactive abnormal element, and if the associated interactive abnormal element is triggered, marking the abnormal code fragment corresponding to the position information in the web page code.

[0090] It should be noted that any one of steps S302 to S316 or any combination of multiple steps can be replaced by the corresponding technical means provided in the above steps S202 to S208 according to the needs of implementation and deployment, and will not be described one by one here.

[0091] One or more embodiments of a page detection processing method provided in this specification are as follows:

[0092] Step 1: Get the page code of the application page of the application in a specific access mode.

[0093] Optionally, the application page is obtained after a page is loaded within the application based on a page access request of the application in the specific access mode.

[0094] This embodiment does not specifically limit the scenario of the application, and the application can be any type of application, such as an application for searching, an application for shopping, etc.; the specific access mode refers to a mode provided for access to specific users, that is, a specific user access mode, for example, the specific users include users with physiological decline, users with physiological defects and / or users with physiological disorders, and users with physiological decline can be elderly users.

[0095] The page type of the application page can be a native page or a web page, for example, the application page can be a Native page, a web page, an H5 page, or other types of pages. Optionally, this embodiment is applied to a page detection component, which is integrated in the application.

[0096] Step 2: Input the page code into a page detection engine to perform adaptation detection of at least one detection dimension under a specific access mode to obtain adaptation abnormality elements of the application page.

[0097] Optionally, the page code is input into the page detection engine after being acquired by the page detection component, and the page detection engine may be a JS (JavaScript) detection engine.

[0098] Step 3: performing code identification in the page code according to the abnormal adaptation element to obtain a code snippet, and generating a detection result of adaptation detection on the application page based on the abnormal adaptation element and the code snippet.

[0099] It should be added that steps 2 and 3 provided in this embodiment are similar to steps S206 to S208 provided in the above embodiment. For example, the adaptation detection of at least one detection dimension under a specific access mode and the process of code recognition and generating detection results in this embodiment are similar to the relevant contents provided in the above embodiment. Therefore, when reading this embodiment, you can refer to the relevant contents provided in the above embodiment.

[0100] An embodiment of a webpage detection and processing device provided in this specification is as follows:

[0101] In the above-mentioned embodiment, a web page detection and processing method is provided, and correspondingly, a web page detection and processing device is also provided, which will be described below with reference to the accompanying drawings.

[0102] Reference Figure 4 , which shows a schematic diagram of an embodiment of a web page detection and processing device provided in this embodiment.

[0103] Since the device embodiment corresponds to the method embodiment, the description is relatively simple, and the relevant parts can refer to the corresponding description of the method embodiment provided above. The device embodiment described below is only illustrative.

[0104] This embodiment provides a web page detection and processing device, including:

[0105] The webpage address acquisition module 402 is configured to acquire the webpage address of the webpage to be detected;

[0106] The webpage loading module 404 is configured to call the driving tool to load the webpage based on the webpage address to obtain webpage resource data, and obtain the webpage code obtained by converting the webpage resource data;

[0107] The adaptation detection module 406 is configured to input the webpage code into a webpage detection engine to perform adaptation detection of at least one detection dimension under a specific access mode, and obtain the adaptation abnormal element of the webpage to be detected;

[0108] The code identification module 408 is configured to perform code identification in the webpage code according to the abnormal adaptation element to obtain a code snippet, and generate a detection result of the adaptation detection of the webpage to be detected based on the abnormal adaptation element and the code snippet.

[0109] An embodiment of a webpage detection and processing device provided in this specification is as follows:

[0110] Corresponding to the web page detection and processing method described above, based on the same technical concept, one or more embodiments of this specification also provide a web page detection and processing device, which is used to execute the web page detection and processing method provided above. Figure 5 A schematic diagram of the structure of a web page detection and processing device provided in one or more embodiments of this specification.

[0111] This embodiment provides a web page detection and processing device, including:

[0112] like Figure 5As shown, the web page detection processing device may have relatively large differences due to different configurations or performances, and may include one or more processors 501 and memory 502, and the memory 502 may store one or more storage applications or data. Among them, the memory 502 may be a short-term storage or a persistent storage. The application stored in the memory 502 may include one or more modules (not shown in the figure), and each module may include a series of computer executable instructions in the web page detection processing device. Furthermore, the processor 501 may be configured to communicate with the memory 502, and execute a series of computer executable instructions in the memory 502 on the web page detection processing device. The web page detection processing device may also include one or more power supplies 503, one or more wired or wireless network interfaces 504, one or more input / output interfaces 505, one or more keyboards 506, etc.

[0113] In a specific embodiment, the web page detection processing device includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer executable instructions for the web page detection processing device, and the one or more programs are configured to be executed by one or more processors, including computer executable instructions for performing the following:

[0114] Get the webpage address of the webpage to be detected;

[0115] Calling a driving tool to load a web page based on the web page address to obtain web page resource data, and obtaining a web page code obtained by converting the web page resource data;

[0116] Inputting the webpage code into a webpage detection engine to perform adaptation detection of at least one detection dimension under a specific access mode, and obtaining an abnormal adaptation element of the webpage to be detected;

[0117] Code identification is performed in the webpage code according to the abnormal adaptation element to obtain a code fragment, and a detection result of the adaptation detection of the webpage to be detected is generated based on the abnormal adaptation element and the code fragment.

[0118] An embodiment of a computer-readable storage medium provided in this specification is as follows:

[0119] Corresponding to the web page detection and processing method described above, based on the same technical concept, one or more embodiments of this specification also provide a computer-readable storage medium.

[0120] The computer-readable storage medium provided in this embodiment is used to store computer-executable instructions, and the computer-executable instructions implement the following steps when executed:

[0121] Get the webpage address of the webpage to be detected;

[0122] Calling a driving tool to load a web page based on the web page address to obtain web page resource data, and obtaining a web page code obtained by converting the web page resource data;

[0123] Inputting the webpage code into a webpage detection engine to perform adaptation detection of at least one detection dimension under a specific access mode, and obtaining an abnormal adaptation element of the webpage to be detected;

[0124] Code identification is performed in the webpage code according to the abnormal adaptation element to obtain a code fragment, and a detection result of the adaptation detection of the webpage to be detected is generated based on the abnormal adaptation element and the code fragment.

[0125] It should be noted that the embodiment of a computer-readable storage medium in this specification and the embodiment of a web page detection and processing method in this specification are based on the same inventive concept, so the specific implementation of this embodiment can refer to the implementation of the aforementioned corresponding method, and the repeated parts will not be repeated.

[0126] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referenced to each other. Each embodiment focuses on the differences from other embodiments. For example, the device embodiment, equipment embodiment and computer-readable storage medium embodiment are similar to the method embodiment, so the description is relatively simple. To read the relevant contents in the device embodiment, equipment embodiment and computer-readable storage medium embodiment, please refer to the partial description of the method embodiment.

[0127] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0128] In the 1930s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the method flow). However, with the development of technology, many improvements to the method flow today can be regarded as direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages ​​and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.

[0129] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.

[0130] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0131] For the convenience of description, the above devices are described in terms of functions and are divided into various units. Of course, when implementing the embodiments of this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0132] It should be understood by those skilled in the art that one or more embodiments of this specification may be provided as a method, system or computer program product. Therefore, one or more embodiments of this specification may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0133] This specification is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable web page detection processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable web page detection processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0134] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable web page detection processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0135] These computer program instructions can also be loaded onto a computer or other programmable web page detection processing device, so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0136] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0137] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0138] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0139] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of features includes not only those features, but also other features not explicitly listed, or also includes features inherent to such process, method, commodity or device. In the absence of further restrictions, features defined by the phrase "including a ..." do not exclude the existence of other identical features in the process, method, commodity or device including the features.

[0140] One or more embodiments of the present specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. One or more embodiments of the present specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0141] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0142] The above description is only an embodiment of this document and is not intended to limit this document. For those skilled in the art, this document may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this document should be included in the scope of the claims of this document.

Claims

1. A web page detection and processing method, comprising: Get the webpage address of the webpage to be detected; Calling a driving tool to load a web page based on the web page address to obtain web page resource data, and obtaining a web page code obtained by converting the web page resource data; Inputting the webpage code into a webpage detection engine to perform adaptation detection of at least one detection dimension under a specific access mode, and obtaining an adaptation abnormal element of the webpage to be detected; Code identification is performed in the webpage code according to the abnormal adaptation element to obtain a code fragment, and a detection result of the adaptation detection of the webpage to be detected is generated based on the abnormal adaptation element and the code fragment.

2. The web page detection and processing method according to claim 1, wherein generating a detection result of performing adaptation detection on the web page to be detected based on the adaptation abnormal element and the code snippet comprises: Performing interaction interface configuration on the adaptation abnormal element to obtain an interaction abnormal element; The position information of the code snippet in the webpage code is associated with the abnormal interaction element, and the associated abnormal interaction element is used as the detection result.

3. The webpage detection and processing method according to claim 2, after associating the position information of the code snippet in the webpage code with the abnormal interaction element and using the associated abnormal interaction element as the detection result operation, further comprising: If the associated abnormal interaction element is triggered, a code segment corresponding to the position information in the webpage code is marked.

4. The webpage detection and processing method according to claim 1, wherein the step of performing code identification in the webpage code to obtain a code fragment according to the abnormal adaptation element comprises: Clustering the abnormal adaptation elements of the web page to be detected according to the detection dimension to obtain clustered abnormal elements; Abnormal code identification is performed on the webpage code according to the clustered abnormal elements to obtain abnormal code fragments.

5. The webpage detection and processing method according to claim 4, wherein generating a detection result of performing adaptation detection on the webpage to be detected based on the adaptation abnormal element and the code snippet comprises: Inputting the clustered abnormal elements and the abnormal code fragments into a code correction component for code correction processing to obtain a corrected code fragment corresponding to the abnormal code fragment; A detection document for performing adaptation detection on the web page to be detected is generated according to the clustered abnormal elements, the abnormal code fragments and the corrected code fragments.

6. The web page detection and processing method according to claim 1, wherein the calling driving tool loads the web page based on the web page address to obtain web page resource data, and obtains the web page code obtained by converting the web page resource data, comprising: Calling the driving tool to load a web page in a browser based on the web page address to obtain DOM structure data of the web page to be detected; The web page code is obtained by converting the DOM structure data into code through the driving tool.

7. The webpage detection processing method according to claim 1, wherein the adaptation detection of any detection dimension in the at least one detection dimension is implemented in the following manner: Parsing the webpage code, and extracting element attribute parameters corresponding to any detection dimension from the code parsing result; Compare the element attribute parameter with a preset access parameter of any detection dimension in the specific access mode; If the comparison result is inconsistent, it is determined that the web page element corresponding to the element attribute parameter is an adaptation abnormal element.

8. The webpage detection and processing method according to claim 1, wherein the detection dimension comprises at least one of the following: Text font detection dimension, text color detection dimension, web page layout detection dimension, and focus area detection dimension.

9. A web page detection and processing device, comprising: A web page address acquisition module is configured to acquire the web page address of the web page to be detected; The webpage loading module is configured to call the driving tool to load the webpage based on the webpage address to obtain webpage resource data, and obtain the webpage code obtained by converting the webpage resource data; An adaptation detection module is configured to input the webpage code into a webpage detection engine to perform adaptation detection of at least one detection dimension under a specific access mode, and obtain an abnormal adaptation element of the webpage to be detected; The code identification module is configured to perform code identification in the webpage code according to the abnormal adaptation element to obtain a code fragment, and generate a detection result of the adaptation detection of the webpage to be detected based on the abnormal adaptation element and the code fragment.

10. A web page detection and processing device, comprising: processor; and a memory configured to store computer executable instructions that, when executed, cause the processor to: Get the webpage address of the webpage to be detected; Calling a driving tool to load a web page based on the web page address to obtain web page resource data, and obtaining a web page code obtained by converting the web page resource data; Inputting the webpage code into a webpage detection engine to perform adaptation detection of at least one detection dimension under a specific access mode, and obtaining an adaptation abnormal element of the webpage to be detected; Code identification is performed in the webpage code according to the abnormal adaptation element to obtain a code fragment, and a detection result of the adaptation detection of the webpage to be detected is generated based on the abnormal adaptation element and the code fragment.

11. A computer-readable storage medium for storing computer-executable instructions, wherein the computer-executable instructions implement the steps of the method of claim 1 when executed.

Citation Information

Patent Citations

  • Page anomaly detection method and device, equipment and storage medium

    CN112130944A

  • Page testing method and device and medium

    CN112667502A

  • Display content testing method and device, equipment, storage medium and program product

    CN114356747A

  • Webpage exception positioning method and device, electronic equipment and storage medium

    CN117056635A

  • Abnormality detection device, abnormality detection system, server, and abnormality detection method

    WO2009038028A1