CN114662029A - Method and device for solidifying webpage content, electronic equipment and storage medium - Google Patents

Method and device for solidifying webpage content, electronic equipment and storage medium Download PDF

Info

Publication number
CN114662029A
CN114662029A CN202210254444.2A CN202210254444A CN114662029A CN 114662029 A CN114662029 A CN 114662029A CN 202210254444 A CN202210254444 A CN 202210254444A CN 114662029 A CN114662029 A CN 114662029A
Authority
CN
China
Prior art keywords
asynchronous request
address
content
asynchronous
web page
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210254444.2A
Other languages
Chinese (zh)
Inventor
张苗
胡煦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202210254444.2A priority Critical patent/CN114662029A/en
Publication of CN114662029A publication Critical patent/CN114662029A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The present disclosure provides a method, an apparatus, an electronic device and a storage medium for solidifying web content, and relates to the technical field of computers, in particular to the technical field of application program design and web page design. The implementation scheme is as follows: a method for solidifying web content, comprising: accessing a webpage to be solidified; acquiring a document for describing webpage content of a webpage page and an asynchronous request result corresponding to an asynchronous request triggered during the webpage page access period, wherein the document comprises an original sending address of the asynchronous request; modifying the document to modify the original sending address to a preset processing address, wherein the preset processing address indicates an updated sending address of the asynchronous request; and storing the modified document and the asynchronous request result, wherein the stored asynchronous request result is returned when the asynchronous request is sent to the preset processing address.

Description

Method and device for solidifying webpage content, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to the field of application programming and web page programming, and in particular, to a method and an apparatus for solidifying web content, an electronic device, a computer-readable storage medium, and a computer program product, and a method for evaluating web page effects.
Background
In the development of application program products providing functions such as web page access, as the products are updated iteratively, the web page content at a specific moment on the line needs to be solidified for evaluating the product effect. The web page content may refer to content that a user presents to the user on a web browser after inputting a network address to be accessed to the web browser. Effectively solidifying web content during product development is important for assessing product effectiveness.
The approaches described in this section are not necessarily approaches that have been previously conceived or pursued. Unless otherwise indicated, it should not be assumed that any of the approaches described in this section qualify as prior art merely by virtue of their inclusion in this section. Similarly, unless otherwise indicated, the problems mentioned in this section should not be considered as having been acknowledged in any prior art.
Disclosure of Invention
The present disclosure provides a method, an apparatus, an electronic device, a computer-readable storage medium, and a computer program product for solidifying web page content, and a method for evaluating web page effects.
According to an aspect of the present disclosure, a method for solidifying web page content is provided. The method comprises the following steps: accessing a webpage to be solidified; acquiring a document for describing webpage content of a webpage page and an asynchronous request result corresponding to an asynchronous request triggered during the webpage page access period, wherein the document comprises an original sending address of the asynchronous request; modifying the document to modify the original sending address to a preset processing address, wherein the preset processing address indicates an updated sending address of the asynchronous request; and storing the modified document and the asynchronous request result, wherein the stored asynchronous request result is returned when the asynchronous request is sent to the preset processing address.
According to another aspect of the present disclosure, an apparatus for solidifying web content is provided. The device comprises: the access module is configured to access a webpage to be solidified; the page acquisition module is configured to acquire a document for describing webpage content of a webpage page and an asynchronous request result corresponding to an asynchronous request triggered during the access of the webpage page, wherein the document comprises an original sending address of the asynchronous request; a modification module configured to modify the document to modify the original sending address to a preset processing address, wherein the preset processing address indicates an updated sending address of the asynchronous request; and a storage module configured to store the modified document and the asynchronous request result, wherein the stored asynchronous request result is returned when the asynchronous request is sent to the preset processing address.
According to another aspect of the present disclosure, a method for evaluating the effectiveness of a web page is provided. The method comprises the following steps: obtaining at least one solidified web content generated for at least one moment according to the method as described above; and evaluating an effect of the web page based on the at least one solidified web content.
According to another aspect of the present disclosure, an electronic device is provided. The electronic device includes: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a method according to the above.
According to another aspect of the present disclosure, there is provided a non-transitory computer readable storage medium having stored thereon computer instructions for causing a computer to perform the method according to the above.
According to another aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein the computer program realizes the method according to the above when executed by a processor.
According to one or more embodiments of the present disclosure, asynchronous content with respect to a web page may be effectively solidified.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate exemplary embodiments of the embodiments and, together with the description, serve to explain the exemplary implementations of the embodiments. The illustrated embodiments are for purposes of illustration only and do not limit the scope of the claims. Throughout the drawings, identical reference numbers designate similar, but not necessarily identical, elements.
FIG. 1 illustrates a schematic diagram of an exemplary system in which various methods described herein may be implemented, according to an embodiment of the present disclosure;
FIG. 2 illustrates a flow diagram of a method for solidifying web page content according to one embodiment of the present disclosure;
FIG. 3 shows a flow diagram of a method for solidifying web content according to another embodiment of the present disclosure;
FIG. 4 illustrates a flow diagram of an example method of obtaining asynchronous request results in accordance with an embodiment of the disclosure;
FIG. 5 shows a schematic diagram of an implementation of a method for solidifying web content according to an embodiment of the present disclosure in an example application scenario;
FIG. 6 shows a block diagram of an apparatus for solidifying web content according to one embodiment of the present disclosure;
FIG. 7 is a block diagram illustrating an apparatus for solidifying web content according to another embodiment of the present disclosure;
FIG. 8 illustrates a block diagram of an exemplary electronic device that can be used to implement embodiments of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
In the present disclosure, unless otherwise specified, the use of the terms "first", "second", and the like to describe various elements is not intended to limit the positional relationship, the temporal relationship, or the importance relationship of the elements, and such terms are used only to distinguish one element from another. In some examples, a first element and a second element may refer to the same instance of the element, and in some cases, based on the context, they may also refer to different instances.
The terminology used in the description of the various described examples in this disclosure is for the purpose of describing particular examples only and is not intended to be limiting. Unless the context clearly indicates otherwise, if the number of elements is not specifically limited, the elements may be one or more. Furthermore, the term "and/or" as used in this disclosure is intended to encompass any and all possible combinations of the listed items.
In the related art, web content that needs to be solidified may generally include both synchronous content and asynchronous content. The synchronization content may refer to content that a user renders based on a HTML (HyperText Markup Language) document returned by a server after entering a network address such as a URL (Uniform Resource Locator). Asynchronous content may be generated at page initialization or may be generated at user interaction. Asynchronous content may generally refer to content rendered based on an asynchronous request initiated via a JavaScript script.
However, current methods for solidifying web content generally only enable solidification for synchronous content, but not for asynchronous content. For example, in order to solidify web page content in the product development process, a product manager may provide URL addresses of one or more web pages to be solidified in advance, and a developer may access the URL addresses to capture and store a corresponding HTML document. However, the HTML documents stored in this process relate only to synchronous content of the corresponding web page and not to asynchronous content. Even if an asynchronous request is initiated by means of JavaScript script in this process, the asynchronous content corresponding to the asynchronous request cannot be saved because the data requested from the server may be different each time the asynchronous request. Therefore, the current method for solidifying the webpage content still has the problem that the asynchronous content cannot be solidified.
In view of at least the above technical problems, according to an aspect of the embodiments of the present disclosure, a method for solidifying web page content is provided. Embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.
Before describing the method of embodiments of the present disclosure in detail, an exemplary system in which the method of embodiments of the present disclosure may be implemented is first described in conjunction with fig. 1.
Fig. 1 illustrates a schematic diagram of an exemplary system 100 in which various methods and apparatus described herein may be implemented in accordance with an embodiment of the present disclosure. Referring to fig. 1, the system 100 includes one or more client devices 101, 102, 103, 104, 105, and 106, a server 120, and one or more communication networks 110 coupling the one or more client devices to the server 120. Client devices 101, 102, 103, 104, 105, and 106 may be configured to execute one or more applications.
In embodiments of the present disclosure, the server 120 may run one or more services or software applications that enable the execution of the method for solidifying web page content.
In some embodiments, the server 120 may also provide other services or software applications that may include non-virtual environments and virtual environments. In certain embodiments, these services may be provided as web-based services or cloud services, for example, provided to users of client devices 101, 102, 103, 104, 105, and/or 106 under a software as a service (SaaS) model.
In the configuration shown in fig. 1, server 120 may include one or more components that implement the functions performed by server 120. These components may include software components, hardware components, or a combination thereof, which may be executed by one or more processors. A user operating a client device 101, 102, 103, 104, 105, and/or 106 may, in turn, utilize one or more client applications to interact with the server 120 to take advantage of the services provided by these components. It should be understood that a variety of different system configurations are possible, which may differ from system 100. Accordingly, fig. 1 is one example of a system for implementing the various methods described herein and is not intended to be limiting.
A user (e.g., a product manager as mentioned above) may use client devices 101, 102, 103, 104, 105, and/or 106 to obtain the solidified web page content. The client device may provide an interface that enables a user of the client device to interact with the client device. The client device may also output information to the user via the interface. Although fig. 1 depicts only six client devices, those skilled in the art will appreciate that any number of client devices may be supported by the present disclosure.
Client devices 101, 102, 103, 104, 105, and/or 106 may include various types of computer devices, such as portable handheld devices, general purpose computers (such as personal computers and laptops), workstation computers, wearable devices, smart screen devices, self-service terminal devices, service robots, gaming systems, thin clients, various messaging devices, sensors or other sensing devices, and so forth. These computer devices may run various types and versions of software applications and operating systems, such as MICROSOFT Windows, APPLE iOS, UNIX-like operating systems, Linux, or Linux-like operating systems (e.g., GOOGLE Chrome OS); or include various Mobile operating systems such as MICROSOFT Windows Mobile OS, iOS, Windows Phone, Android. Portable handheld devices may include cellular telephones, smart phones, tablets, Personal Digital Assistants (PDAs), and the like. Wearable devices may include head-mounted displays (such as smart glasses) and other devices. The gaming system may include a variety of handheld gaming devices, internet-enabled gaming devices, and the like. The client device is capable of executing a variety of different applications, such as various Internet-related applications, communication applications (e.g., email applications), Short Message Service (SMS) applications, and may use a variety of communication protocols.
Network 110 may be any type of network known to those skilled in the art that may support data communications using any of a variety of available protocols, including but not limited to TCP/IP, SNA, IPX, etc. By way of example only, one or more networks 110 may be a Local Area Network (LAN), an ethernet-based network, a token ring, a Wide Area Network (WAN), the internet, a virtual network, a Virtual Private Network (VPN), an intranet, an extranet, a Public Switched Telephone Network (PSTN), an infrared network, a wireless network (e.g., bluetooth, WIFI), and/or any combination of these and/or other networks.
The server 120 may include one or more general purpose computers, special purpose server computers (e.g., PC (personal computer) servers, UNIX servers, mid-end servers), blade servers, mainframe computers, server clusters, or any other suitable arrangement and/or combination. The server 120 may include one or more virtual machines running a virtual operating system, or other computing architecture involving virtualization (e.g., one or more flexible pools of logical storage that may be virtualized to maintain virtual storage for the server). In various embodiments, the server 120 may run one or more services or software applications that provide the functionality described below.
The computing units in server 120 may run one or more operating systems including any of the operating systems described above, as well as any commercially available server operating systems. The server 120 may also run any of a variety of additional server applications and/or middle tier applications, including HTTP servers, FTP servers, CGI servers, JAVA servers, database servers, and the like.
In some implementations, the server 120 may include one or more applications to analyze and consolidate data feeds and/or event updates received from users of the client devices 101, 102, 103, 104, 105, and/or 106. Server 120 may also include one or more applications to display data feeds and/or real-time events via one or more display devices of client devices 101, 102, 103, 104, 105, and/or 106.
In some embodiments, the server 120 may be a server of a distributed system, or a server incorporating a blockchain. The server 120 may also be a cloud server, or a smart cloud computing server or a smart cloud host with artificial intelligence technology. The cloud Server is a host product in a cloud computing service system, and is used for solving the defects of high management difficulty and weak service expansibility in the traditional physical host and Virtual Private Server (VPS) service.
The system 100 may also include one or more databases 130. In some embodiments, these databases may be used to store data and other information. For example, one or more of the databases 130 may be used to store information such as audio files and video files. The database 130 may reside in various locations. For example, the database used by the server 120 may be local to the server 120, or may be remote from the server 120 and may communicate with the server 120 via a network-based or dedicated connection. The database 130 may be of different types. In certain embodiments, the database used by the server 120 may be, for example, a relational database. One or more of these databases may store, update, and retrieve data to and from the database in response to the command.
In some embodiments, one or more of the databases 130 may also be used by applications to store application data. The databases used by the application may be different types of databases, such as key-value stores, object stores, or regular stores supported by a file system.
The system 100 of fig. 1 may be configured and operated in various ways to enable application of the various methods and apparatus described in accordance with the present disclosure.
FIG. 2 shows a flow diagram of a method 200 for solidifying web page content according to an embodiment of the present disclosure. As shown in fig. 2, the method 200 includes the steps of:
in step S202, a web page to be solidified is accessed.
In step S204, a document describing the web content of the web page and asynchronous request results corresponding to asynchronous requests triggered during access to the web page are acquired. The document includes the original sending address of the asynchronous request.
In step S206, the document is modified to modify the original transmission address to a preset processing address. The preset processing address indicates an updated transmission address of the asynchronous request.
In step S208, the modified document is stored along with the asynchronous request result. And returning the stored asynchronous request result when the asynchronous request is sent to the preset processing address.
According to the method for solidifying the webpage content, when the webpage is accessed to solidify the webpage content, in order to solidify asynchronous content related to the asynchronous request, the sending address of the asynchronous request in the webpage document is pertinently modified to the preset processing address to be processed, and the asynchronous request result corresponding to the asynchronous request is stored. By arranging the processing logic at the preset processing address to return the stored asynchronous request result when an asynchronous request is sent to the preset processing address, the asynchronous request can be always bound with the stored asynchronous request result without data change, thereby enabling the same asynchronous request result to be requested from the preset processing address whenever the asynchronous request is triggered again, and ensuring that the asynchronous content related to the asynchronous request can be solidified.
One or more aspects of the steps of a method for solidifying web page content according to an embodiment of the present disclosure will be described in detail below.
According to some embodiments, at step S202, a network address of a web page may be accessed using a headless browser.
Considering that headless browsers may run in the background without displaying a browser user interface, faster running speeds may be provided compared to normal browsers. Accordingly, an HTML document of a web page can be quickly crawled by using a headless browser.
In an example, step S202 may be performed, for example, by server 120 described in connection with fig. 1. The URL address of the web page to be solidified may be provided to the server 120 for access by the server 120. The server 120 may access the URL address using a headless browser. To do so, the server 120 may open a headless browser, listen for browser requests, and access the URL address of the web page to be cured. The headless browser may be, for example, a Chrome headless browser.
In an example, step S202 may be an automated task, i.e., the server 120 may execute this step automatically by running pre-written code. This may be achieved, for example, by node technology adapted to the front end.
In step S204, the document for describing the web page content of the web page may be an HTML document. By accessing the web page to be solidified at step S202, the HTML document of the web page can be captured. The HTML document can be used to render the synchronized content of the web page.
In addition, asynchronous request results corresponding to asynchronous requests triggered during access to a web page may also be captured. The asynchronous request results may be used to render asynchronous content related to the asynchronous request. In an example, the asynchronous request may be triggered by JavaScript script during initialization of the web page.
In an example, step S204 may also be performed, for example, by the server 120. Here, the server 120 may run pre-written code to capture the HTML document for the web page. The HTML document may include the original sending address of the asynchronous request. The asynchronous request result corresponding to the asynchronous request may be returned from the original sending address and retrieved by the server 200.
In an example, step S204 may also be an automated task, i.e., the server 120 may execute this step automatically by running pre-written code. This can also be achieved, for example, by node technology adapted to the front end.
According to some embodiments, obtaining the asynchronous request result at step S204 may include: monitoring an asynchronous request automatically triggered during the access of a webpage; and snatching the asynchronous request result returned in response to the asynchronous request.
By the method, the asynchronous request associated with the asynchronous content can be monitored in the process of solidifying the webpage content, and the asynchronous request result corresponding to the asynchronous request can be obtained, so that a basis is provided for solidification of the asynchronous content.
In an example, the asynchronous request may be automatically triggered by a JavaScript script during initialization of the web page when the web page to be solidified is accessed through the headless browser. The original sending address of the asynchronous request may be contained in the HTML document of the web page. The asynchronous request result corresponding to the asynchronous request may be returned from the original sending address.
In an example, the listening may be stopped when the initialization process of the web page to be solidified is completed.
A flowchart of an example method of obtaining asynchronous request results is described in further detail below in conjunction with fig. 4.
In step S206, the HTML document acquired in step S204 may be modified by, for example, the server 120 to modify the transmission address (i.e., transmission destination) of the asynchronous request to a preset processing address. A service dedicated to processing asynchronous requests may be set at the preset processing address.
In an example, an "ajaxUrl" field in the HTML document representing the original sending address of the asynchronous request may be modified to replace the original sending address with a preset processing address.
In step S208, the modified document is stored along with the asynchronous request results, where the stored asynchronous request results may be bound with the asynchronous request. That is, processing logic is provided at the preset processing address: and returning the stored asynchronous request result when the asynchronous request is sent to the preset processing address. Therefore, the same asynchronous request result can be requested from the preset processing address every time the asynchronous request is triggered again, and therefore the asynchronous content related to the asynchronous request can be solidified.
According to some embodiments, storing the modified document and the asynchronous request result at step S208 may include: and generating a storage address for the modified document and the asynchronous request result, wherein when the storage address is accessed, the asynchronous request is triggered and sent to a preset processing address.
In this way, a memory address of the solidified web page content may be generated, such that the asynchronous request result obtained during accessing the memory address is the same as the previously obtained asynchronous request result, and therefore the asynchronous content corresponding to the asynchronous request result is always the same. In other words, whenever an asynchronous request is triggered again by accessing the memory address, the fetched asynchronous request result is always the same, and thus the corresponding asynchronous content is solidified.
In an example, the modified document and the asynchronous request result may be stored, such as by server 120, at a storage device located in server 120 or located outside of server 120.
According to some embodiments, the asynchronous request may be parsed at a preset processing address to return a stored asynchronous request result based on a correspondence between the asynchronous request and the asynchronous request result.
In the above manner, whenever an asynchronous request is triggered again and sent to a preset processing address, it is possible to know which one or more stored asynchronous request results correspond thereto by parsing the asynchronous request. Thus, the same asynchronous request result can be always requested, so that the same asynchronous content corresponding to the asynchronous request result can be solidified.
As previously described, since the method for solidifying web page content according to the embodiments of the present disclosure may ensure that the same asynchronous request result is always obtained for a particular asynchronous request, the same asynchronous content is enabled to be solidified as such.
FIG. 3 shows a flow diagram of a method 300 for solidifying web page content according to another embodiment of the present disclosure. As shown in fig. 3, the method 300 may include steps S302, S304, S306, and S308 similar to steps S202, S204, S206, and S208 described in conjunction with fig. 2, and thus details of one or more aspects of these steps are not repeated here.
The method 300 may further include step S310 of generating the solidified web page content. The step S310 may further include: step S3110, generating synchronized content of the web page rendered based on the stored modified document; and step S3120 of generating asynchronous content regarding the asynchronous request rendered based on the stored asynchronous request result.
Through the method, the solidified synchronous content and the solidified asynchronous content of the webpage can be acquired simultaneously, so that a more accurate evaluation reference can be provided for evaluating the product effect.
According to an aspect of the embodiment of the present disclosure, a method for evaluating the effect of a webpage is also provided. The method can comprise the following steps: acquiring at least one solidified webpage content generated for at least one moment according to the method; and evaluating an effect of the web page based on the at least one solidified web content.
Because the method according to the embodiment of the present disclosure can effectively solidify the web page content, especially the asynchronous content, for a specific moment, on this basis, the evaluation of the web page effect can be facilitated or promoted by further solidifying the web page content for a plurality of moments.
FIG. 4 illustrates a flow diagram of an example method 400 of obtaining asynchronous request results in accordance with an embodiment of the disclosure.
In an example, the method 400 of obtaining asynchronous request results as shown in fig. 4 may be performed by the server 120 described in conjunction with fig. 1. The method may be implemented using node technology and headless browsers suitable for the front end.
As shown in fig. 4, method 400 may include: in step S401, a headless browser is opened; in step S402, a browser request is monitored; and in step S403, accessing the URL address of the web page to be solidified.
In addition, the method 400 may further include performing steps for acquiring synchronous content and asynchronous content in steps S404 and S405, respectively. That is, in step S404, the document request may be listened to and the HTML document of the web page may be crawled. The HTML document may be used to render the synchronized content of the web page; and in step S405, may listen for an auto-triggered asynchronous request and grab asynchronous request results returned in response to the asynchronous request. The asynchronous request results may be used to render asynchronous content for the asynchronous request.
The method 400 may further include step S406, i.e., listening may be stopped when the initialization process of the web page is completed.
According to the method 400 of obtaining asynchronous request results as shown in fig. 4, synchronous content and asynchronous content on a web page can be obtained simultaneously, thereby facilitating providing a more accurate evaluation reference for evaluating the product effect through the solidified synchronous content and asynchronous content.
FIG. 5 shows a schematic diagram of a method 500 for solidifying web content according to an embodiment of the present disclosure implemented in an example application scenario.
As shown in fig. 5, method 500 may include offline operation 510 and online operation 520. Offline operation 510 may involve steps for generating solidified web content. Online operation 520 may involve the step of generating the solidified web page content.
Offline operations 510 may include a grab operation 512, a modify operation 514, and a store operation 516. As shown in fig. 5, the HTML document of the web page to be solidified and the asynchronous request result corresponding to the asynchronous request may be obtained through the crawling operation 512. The original send address of the asynchronous request may be modified to a preset processing address by a modify operation 514. Operation 522 for asynchronous request processing may be performed at the preset processing address. Here, operation 522 for asynchronous request processing is included in online operation 520. The HTML document modified by the modify operation 514 and the asynchronous request results obtained by the grab operation 512 may be stored, such as generating corresponding storage addresses, by the store operation 516. Since the above-mentioned grabbing operation 512, modifying operation 514 and storing operation 516 may correspond to steps S204, S206 and S208, respectively, described in connection with fig. 1, details of various aspects thereof are not repeated here.
In an example application scenario, when a user, such as a product manager, obtains the storage address, the user can access the storage address through a local client device (such as the various client devices described in conjunction with fig. 1), that is, open a web page of the storage address through a browser. At this point, an asynchronous request in the HTML document will be triggered and sent to the modified pre-set processing address. By performing operation 522 for asynchronous request processing at the preset processing address, the asynchronous request may be parsed and associated to the asynchronous request result stored in storage operation 516. That is, operation 522 of asynchronous request processing provides the processing logic to: and returning the stored asynchronous request result when the asynchronous request is sent to the preset processing address. Thereby enabling asynchronous requests triggered by the user when opening a memory address to request the same asynchronous request result as before. Accordingly, the user can see the solidified asynchronous content.
Thus, the user can obtain the solidified synchronous content through the stored modified document and also obtain the solidified asynchronous content through the stored asynchronous request result, and the more accurate evaluation reference is provided for evaluating the product effect.
Fig. 6 shows a block diagram of an apparatus 600 for solidifying web content according to an embodiment of the present disclosure.
As shown in FIG. 6, apparatus 600 includes an access module 602, a page fetch module 604, a modification module 606, and a storage module 608.
The access module 602 is configured to access a web page to be solidified.
The page retrieval module 604 is configured to retrieve a document describing web page content of a web page and asynchronous request results corresponding to asynchronous requests triggered during access to the web page, wherein the document includes an original transmission address of the asynchronous request.
The modification module 606 is configured to modify the document to modify the original sending address to a preset processing address, wherein the preset processing address indicates an updated sending address of the asynchronous request.
The storage module 608 is configured to store the modified document and the asynchronous request result, wherein the stored asynchronous request result is returned when the asynchronous request is sent to the preset processing address.
The operations performed by the above-mentioned modules 602 to 608 may correspond to the steps S202 to S208 described with reference to fig. 2, and therefore, the details of the aspects thereof are not repeated herein.
Fig. 7 shows a block diagram of an apparatus 700 for solidifying web content according to another embodiment of the present disclosure. Modules 702 through 708 shown in fig. 7 may correspond to modules 602 through 608 shown in fig. 6, respectively. In addition, the apparatus 700 and one or more of the modules 702 to 708 may include further sub-functional modules, as will be described in more detail below.
According to some embodiments, the access module 702 may include: an address accessing unit 7020 configured to access a network address of the web page using the headless browser.
According to some embodiments, page acquisition module 704 may include: a listening unit 7040 configured to listen for an asynchronous request that is automatically triggered during access to a web page; and a crawling unit 7042 configured to crawl asynchronous request results returned in response to the asynchronous requests.
According to some embodiments, the storage module 708 may include: an address generating unit 7080 configured to generate a storage address for the modified document and the asynchronous request result, wherein, when the storage address is accessed, the asynchronous request is triggered and sent to the preset processing address.
According to some embodiments, the asynchronous request is parsed at the preset processing address to return the stored asynchronous request result based on a correspondence between the asynchronous request and the asynchronous request result.
According to some embodiments, the apparatus 700 may further comprise a content generation module 710, wherein the content generation module 710 may comprise: a synchronized content generating unit 7100 configured to generate synchronized content of the webpage rendered based on the stored modified document; and an asynchronous content generating unit 7102 configured to generate asynchronous content with respect to the asynchronous request rendered based on the stored asynchronous request result.
According to another aspect of the present disclosure, there is also provided an electronic device including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to cause the at least one processor to perform a method according to an embodiment of the disclosure.
According to another aspect of the present disclosure, there is also provided a non-transitory computer readable storage medium having stored thereon computer instructions for causing a computer to perform the method according to the embodiments of the present disclosure.
According to another aspect of the present disclosure, there is also provided a computer program product comprising a computer program, wherein the computer program, when executed by a processor, implements the method according to embodiments of the present disclosure.
Referring to fig. 8, a block diagram of a structure of an electronic device 800, which may be a server or a client of the present disclosure, which is an example of a hardware device that may be applied to aspects of the present disclosure, will now be described. Electronic device is intended to represent various forms of digital electronic computer devices, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 8, the electronic device 800 includes a computing unit 801 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM)802 or a computer program loaded from a storage unit 808 into a Random Access Memory (RAM) 803. In the RAM803, various programs and data required for the operation of the electronic apparatus 800 can also be stored. The calculation unit 801, the ROM802, and the RAM803 are connected to each other by a bus 804. An input/output (I/O) interface 805 is also connected to bus 804.
A number of components in the electronic device 800 are connected to the I/O interface 805, including: an input unit 806, an output unit 807, a storage unit 808, and a communication unit 809. The input unit 806 may be any type of device capable of inputting information to the electronic device 800, and the input unit 806 may receive input numeric or character information and generate key signal inputs related to user settings and/or function controls of the electronic device, and may include, but is not limited to, a mouse, a keyboard, a touch screen, a track pad, a track ball, a joystick, a microphone, and/or a remote controller. Output unit 807 can be any type of device capable of presenting information and can include, but is not limited to, a display, speakers, a video/audio output terminal, a vibrator, and/or a printer. The storage unit 808 may include, but is not limited to, a magnetic disk, an optical disk. The communication unit 809 allows the electronic device 800 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunications networks, and may include, but is not limited to, modems, network cards, infrared communication devices, wireless communication transceivers and/or chipsets, such as bluetooth (TM) devices, 802.11 devices, WiFi devices, WiMax devices, cellular communication devices, and/or the like.
Computing unit 801 may be a variety of general and/or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and the like. The computing unit 801 performs the various methods and processes described above, such as a method for solidifying web page content. For example, in some embodiments, the method for solidifying web page content may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 808. In some embodiments, part or all of the computer program can be loaded and/or installed onto the electronic device 800 via the ROM802 and/or the communication unit 809. When loaded into RAM803 and executed by computing unit 801, may perform one or more of the steps of the method for solidifying web content described above. Alternatively, in other embodiments, the computing unit 801 may be configured to perform the method for solidifying web page content by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server with a combined blockchain.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be performed in parallel, sequentially or in different orders, and are not limited herein as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved.
In the technical scheme of the disclosure, the acquisition, storage, application and the like of the related webpage information all accord with the regulations of related laws and regulations, and do not violate the good customs of the public order.
Although embodiments or examples of the present disclosure have been described with reference to the accompanying drawings, it is to be understood that the above-described methods, systems and apparatus are merely exemplary embodiments or examples and that the scope of the present invention is not limited by these embodiments or examples, but only by the claims as issued and their equivalents. Various elements in the embodiments or examples may be omitted or may be replaced with equivalents thereof. Further, the steps may be performed in an order different from that described in the present disclosure. Further, various elements in the embodiments or examples may be combined in various ways. It is important that as technology evolves, many of the elements described herein may be replaced with equivalent elements that appear after the present disclosure.

Claims (16)

1. A method for solidifying web content, comprising:
accessing a webpage to be solidified;
acquiring a document for describing webpage content of the webpage page and an asynchronous request result corresponding to an asynchronous request triggered during the period of accessing the webpage page, wherein the document comprises an original sending address of the asynchronous request;
modifying the document to modify the original sending address to a preset processing address, wherein the preset processing address indicates an updated sending address of the asynchronous request; and
storing the modified document and the asynchronous request result, wherein the asynchronous request result is returned when the asynchronous request is sent to the preset processing address.
2. The method of claim 1, wherein the accessing a web page to be solidified comprises:
and accessing the network address of the webpage by using the headless browser.
3. The method of claim 1 or 2, wherein the obtaining asynchronous request results comprises:
monitoring the asynchronous request automatically triggered during the access of the webpage; and
and snatching the asynchronous request result returned in response to the asynchronous request.
4. The method of any of claims 1-3, wherein the storing the modified document and the asynchronous request result comprises:
generating a storage address for the modified document and the asynchronous request result, wherein the asynchronous request is triggered and sent to the preset processing address when the storage address is accessed.
5. The method of any of claims 1-4, wherein the asynchronous request is parsed at the preset processing address to return the stored asynchronous request result based on a correspondence between the asynchronous request and the asynchronous request result.
6. The method of any of claims 1 to 5, further comprising: generating solidified web content, wherein the generating solidified web content comprises:
generating synchronized content of the web page rendered based on the stored modified document; and
generating asynchronous content with respect to the asynchronous request rendered based on the stored asynchronous request results.
7. A method for evaluating the effectiveness of a web page, comprising:
obtaining at least one solidified web content generated for at least one moment according to the method of claim 6; and
based on the at least one solidified web page content, an effect of the web page is evaluated.
8. An apparatus for solidifying web content, comprising:
the access module is configured to access a webpage to be solidified;
a page acquisition module configured to acquire a document describing web page content of the web page and an asynchronous request result corresponding to an asynchronous request triggered during access to the web page, wherein the document includes an original transmission address of the asynchronous request;
a modification module configured to modify the document to modify the original sending address to a preset processing address, wherein the preset processing address indicates an updated sending address of the asynchronous request; and
a storage module configured to store the modified document and the asynchronous request result, wherein the stored asynchronous request result is returned when the asynchronous request is sent to the preset processing address.
9. The apparatus of claim 8, wherein the access module comprises:
an address access unit configured to access a network address of the web page using a headless browser.
10. The apparatus of claim 8 or 9, wherein the page acquisition module comprises:
a listening unit configured to listen for the asynchronous request automatically triggered during access to the web page; and
a crawling unit configured to crawl the asynchronous request results returned in response to the asynchronous request.
11. The apparatus of any of claims 8 to 10, wherein the storage module comprises:
an address generation unit configured to generate a storage address for the modified document and the asynchronous request result, wherein the asynchronous request is triggered and sent to the preset processing address when the storage address is accessed.
12. The apparatus of any of claims 8 to 11, wherein the asynchronous request is parsed at the preset processing address to return the stored asynchronous request result based on a correspondence between the asynchronous request and the asynchronous request result.
13. The apparatus of any of claims 8 to 12, further comprising a content generation module configured to generate the solidified web content, wherein the content generation module comprises:
a synchronized content generating unit configured to generate synchronized content of the web page rendered based on the stored modified document; and
an asynchronous content generation unit configured to generate asynchronous content with respect to the asynchronous request rendered based on the stored asynchronous request result.
14. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein
The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-6.
15. A non-transitory computer readable storage medium having stored thereon computer instructions for causing a computer to perform the method of any one of claims 1-6.
16. A computer program product comprising a computer program, wherein the computer program realizes the method according to any one of claims 1-6 when executed by a processor.
CN202210254444.2A 2022-03-15 2022-03-15 Method and device for solidifying webpage content, electronic equipment and storage medium Pending CN114662029A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210254444.2A CN114662029A (en) 2022-03-15 2022-03-15 Method and device for solidifying webpage content, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210254444.2A CN114662029A (en) 2022-03-15 2022-03-15 Method and device for solidifying webpage content, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114662029A true CN114662029A (en) 2022-06-24

Family

ID=82029304

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210254444.2A Pending CN114662029A (en) 2022-03-15 2022-03-15 Method and device for solidifying webpage content, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114662029A (en)

Similar Documents

Publication Publication Date Title
US11023558B1 (en) Executing functions on-demand on a server utilizing web browsers
CN113986788B (en) Data processing method and device, chip, electronic equipment and medium
CN113656423B (en) Method and device for updating data, electronic equipment and storage medium
CN113377809A (en) Data processing method and apparatus, computing device, and medium
CN112732312A (en) Method and device for updating application program, electronic equipment and medium
CN112948018A (en) Dynamic library loading method, device, equipment and medium for small program
CN112860566B (en) Applet detection method, device, electronic equipment and readable medium
CN114490126A (en) Page processing method and device, electronic equipment and storage medium
CN114035829A (en) Page component updating method and device, electronic equipment and storage medium
CN113641936A (en) Method and device for page jump, electronic equipment and storage medium
CN114510308B (en) Method, device, equipment and medium for storing application page by mobile terminal
CN113641929B (en) Page rendering method, device, electronic equipment and computer readable storage medium
CN115756696A (en) Information processing method, device, equipment and medium
CN113839944B (en) Method, device, electronic equipment and medium for coping with network attack
CN116150517A (en) Page processing method and device, electronic equipment and medium
CN114662029A (en) Method and device for solidifying webpage content, electronic equipment and storage medium
CN113079046A (en) Data access method and device, electronic equipment and medium
CN113760568A (en) Data processing method and device
CN111176982A (en) Test interface generation method and device
CN114218516B (en) Webpage processing method and device, electronic equipment and storage medium
CN113010383B (en) Error log filtering method, device, electronic equipment and readable medium
EP4152174A1 (en) Data processing method and apparatus, and computing device and medium
CN115146201A (en) Page time cheating screening method and device, electronic equipment and medium
CN114924863A (en) Task processing method and device and electronic equipment
CN113961189A (en) Webpage editing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination