Methods, devices, target terminals, and storage media for acquiring web page data
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-05
- Publication Date
- 2026-08-14
AI Technical Summary
[0003]传统自动化处理发票查验技术通常仅对发票查验结果进行简单截图,对于第二种发票查验结果,还需额外点击货物明细按钮使页面显示货物明细才能进行再次截图,此时,需要用户查看两张截图才能获取发票的完整信息,影响用户体验
[0016]This application provides a method, apparatus, target terminal, and storage medium for acquiring web page data. The method includes: responding to an invoice verification request for a target invoice, displaying an invoice verification result page for the target invoice, the invoice verification result page including invoice information; detecting whether a goods details button exists on the invoice verification result page; if the goods details button exists, clicking the goods details button to display a goods details window corresponding to the target invoice, and obtaining window position parameters corresponding to the goods details window, the goods details window including goods details information; adjusting current page display parameters according to the window position parameters and the result page position parameters corresponding to the invoice verification result page, such that the current display page of the target terminal simultaneously displays the invoice verification result page and the goods details window; and obtaining page display information corresponding to the current display page, the page display information including the invoice information and the goods details information. In this embodiment, when a goods details window is detected hidden in the invoice verification result page, the window position parameters corresponding to the goods details window are automatically obtained. Based on the window position parameters and the result page position parameters, the current page display parameters are adjusted so that the current display page simultaneously displays the invoice verification result page and the goods details window. The page display information (long screenshot or PDF) obtained through the current display page includes both invoice information and goods details information, making it convenient for users to view the complete information of the invoice, thereby improving the user experience.
Smart Images

Figure CN119179821B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a method, apparatus, target terminal and storage medium for acquiring web page data. Background Technology
[0002] The invoice verification results of the existing invoice verification system can be displayed in one of the following two ways: First, both the invoice information and the corresponding goods details are displayed on the invoice verification results page; second, the invoice information is displayed on the invoice verification results page, while the specific goods details are hidden in the goods details button on the invoice verification results page.
[0003] Traditional automated invoice verification technology typically only takes a simple screenshot of the invoice verification result. For the second type of invoice verification result, the user needs to click the "Goods Details" button to display the goods details before taking another screenshot. In this case, the user needs to view two screenshots to obtain the complete invoice information, which affects the user experience. Summary of the Invention
[0004] This application provides a method, apparatus, target terminal, and storage medium for acquiring web page data, which can enable the acquired page display information (long screenshot or PDF) to simultaneously include invoice information and goods details, making it convenient for users to view the complete information of the invoice, thereby improving the user experience.
[0005] In a first aspect, embodiments of this application provide a method for acquiring webpage data, the method being applied to a target terminal, the method comprising:
[0006] In response to an invoice verification request for a target invoice, an invoice verification result page for the target invoice is displayed, the invoice verification result page including invoice information;
[0007] Check if a "Goods Details" button exists on the invoice verification results page;
[0008] If the "Goods Details" button exists, clicking the "Goods Details" button will display the "Goods Details" window corresponding to the target invoice, so as to obtain the window position parameters corresponding to the "Goods Details" window. The "Goods Details" window includes goods details information.
[0009] The current page display parameters are adjusted according to the window position parameters and the result page position parameters corresponding to the invoice verification result page, so that the current display page of the target terminal simultaneously displays the invoice verification result page and the goods details window;
[0010] Obtain the page display information corresponding to the currently displayed page, the page display information including the invoice information and the goods details information.
[0011] Secondly, embodiments of this application also provide a webpage data acquisition device, which is deployed on a target terminal and includes:
[0012] The sending and receiving unit is used to obtain the invoice verification request for the target invoice;
[0013] The processing unit is configured to, in response to an invoice verification request for a target invoice, display an invoice verification result page for the target invoice, the invoice verification result page including invoice information; detect whether a goods details button exists on the invoice verification result page; if the goods details button exists, click the goods details button to display a goods details window corresponding to the target invoice, and obtain window position parameters corresponding to the goods details window, the goods details window including goods details information; adjust the current page display parameters according to the window position parameters and the result page position parameters corresponding to the invoice verification result page, so that the current display page of the target terminal simultaneously displays the invoice verification result page and the goods details window; and obtain page display information corresponding to the current display page, the page display information including the invoice information and the goods details information.
[0014] Thirdly, embodiments of this application also provide a target terminal, which includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the above-described method.
[0015] Fourthly, embodiments of this application also provide a computer-readable storage medium storing a computer program, the computer program including program instructions that, when executed by a processor, can implement the above-described method.
[0016] This application provides a method, apparatus, target terminal, and storage medium for acquiring web page data. The method includes: responding to an invoice verification request for a target invoice, displaying an invoice verification result page for the target invoice, the invoice verification result page including invoice information; detecting whether a goods details button exists on the invoice verification result page; if the goods details button exists, clicking the goods details button to display a goods details window corresponding to the target invoice, and obtaining window position parameters corresponding to the goods details window, the goods details window including goods details information; adjusting current page display parameters according to the window position parameters and the result page position parameters corresponding to the invoice verification result page, such that the current display page of the target terminal simultaneously displays the invoice verification result page and the goods details window; and obtaining page display information corresponding to the current display page, the page display information including the invoice information and the goods details information. In this embodiment, when a goods details window is detected hidden in the invoice verification result page, the window position parameters corresponding to the goods details window are automatically obtained. Based on the window position parameters and the result page position parameters, the current page display parameters are adjusted so that the current display page simultaneously displays the invoice verification result page and the goods details window. The page display information (long screenshot or PDF) obtained through the current display page includes both invoice information and goods details information, making it convenient for users to view the complete information of the invoice, thereby improving the user experience. Attached Figure Description
[0017] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 A flowchart illustrating the method for obtaining web page data provided in an embodiment of this application;
[0019] Figure 2 A flowchart illustrating a method for obtaining web page data according to another embodiment of this application;
[0020] Figure 3 A schematic block diagram of a web page data acquisition device provided in the embodiments of this application;
[0021] Figure 4 A schematic block diagram of the target terminal provided in the embodiments of this application. Detailed Implementation
[0022] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0023] It should be understood that, when used in this specification and the appended claims, the terms "comprising" and "including" indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.
[0024] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of the application. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0025] It should also be further understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0026] This application provides a method, apparatus, target terminal, and storage medium for acquiring web page data.
[0027] The execution subject of the webpage data acquisition method can be the webpage data acquisition device provided in the embodiments of this application, or a target terminal that integrates the webpage data acquisition device. The webpage data acquisition device can be implemented in hardware or software, and the target terminal can be a smartphone, tablet computer, handheld computer, or laptop computer, etc.
[0028] Figure 1 This is a flowchart illustrating the method for obtaining webpage data provided in an embodiment of this application. For example... Figure 1 As shown, the method includes the following steps S110-S150.
[0029] S110. In response to an invoice verification request for the target invoice, display the invoice verification result page for the target invoice, the invoice verification result page including invoice information.
[0030] Specifically, the invoice verification request is used to request invoice verification information of the target invoice from the invoice verification system. When the target terminal receives the invoice verification request for the target invoice, it automatically accesses the website corresponding to the invoice verification system through Selenium and automatically enters the invoice identifier of the target invoice in the invoice information input window of the invoice verification system. The invoice identifier includes the invoice code and / or invoice number. Then, the invoice verification system returns the page information of the invoice verification result page to the target terminal. At this time, the target terminal displays the invoice verification result page based on the page information.
[0031] S120. Check if there is a goods details button on the invoice verification result page; if yes, proceed to step S130; if no, proceed to step S150.
[0032] The invoice verification system provides two types of invoice verification result display pages. The first type displays both the invoice information and the corresponding goods details on the invoice verification result page. The second type displays the invoice information on the invoice verification result page, while the specific goods details are hidden in the goods details button on the invoice verification result page.
[0033] If it is the first type of display page, there is no need to reorganize the page data at this time, and step S150 is executed. If it is the second type of display page, the page data needs to be reorganized through steps S130-S140, and then step S150 is executed, so as to ensure that invoice information and goods details information can be displayed simultaneously on the same display page.
[0034] Specifically, this embodiment can determine whether a goods detail button exists on the invoice verification result page by detecting the feature value of the goods detail button in the page source code. For example, the button text of each button in the page source code is obtained. If the button text "View Goods Detail List" exists, it is determined that a goods detail button exists on the invoice verification result page; otherwise, it is determined that a goods detail button does not exist on the invoice verification result page.
[0035] If the invoice verification results page has a "goods details" button, it means that the current invoice verification results page does not display goods details information. If the "goods details" button does not exist, it means that the current invoice verification results page displays both invoice information and goods details information.
[0036] S130. Click the goods details button to display the goods details window corresponding to the target invoice, so as to obtain the window position parameters corresponding to the goods details window. The goods details window includes goods details information.
[0037] In this embodiment, in order to determine the window position parameters corresponding to the goods details window, it is first necessary to simulate clicking the goods details button using Selenium, and after the webpage loads the goods details window, the target terminal determines the window position parameters corresponding to the goods details window based on the parameters displayed on the current page.
[0038] S140. Adjust the current page display parameters according to the window position parameters and the result page position parameters corresponding to the invoice verification result page, so that the current display page of the target terminal simultaneously displays the invoice verification result page and the goods details window.
[0039] In this embodiment, in order to display invoice information and goods details on the current page at the same time, and to allow users to obtain both information through a long screenshot or PDF, it is necessary to reorganize the web page data and adjust the display parameters of the current page.
[0040] For example, the goods details window is originally displayed in front of the invoice verification result page, obscuring the invoice verification result page. By adjusting the window position parameters, the goods details window and the invoice verification result page can be displayed simultaneously. Simultaneous display means that the goods details window does not obscure the invoice verification result page. For example, by adjusting the window position parameters and the recognition result page position parameters, the window position parameters can be concatenated to positions above or below (bottom of) the recognition result page position parameters in the current display page of the target terminal, so that the goods details window is displayed above or below the invoice verification result page in the current display page of the target terminal.
[0041] In some embodiments, step S140 includes: obtaining the result page position parameter; and appending the window position parameter to the bottom of the result page position parameter to adjust the current page display parameter.
[0042] Specifically, after determining the window position parameters corresponding to the goods details window, the window position parameters (top parameter) of the goods details window are adjusted by executing preset JS statements through Selenium. The window position parameters are then appended to the bottom of the page parameters corresponding to the invoice verification results, thus completing the adjustment of the current page display parameters and achieving intelligent recognition and reorganization of web page data.
[0043] As can be seen, in this embodiment, by automatically splicing the window position parameter to the bottom of the invoice display position parameter, the web page data of the target terminal display page is reorganized, so that the invoice information and the goods details information are displayed on the current display page at the same time, and the goods details information is displayed at the bottom of the invoice information, which is convenient for users to view.
[0044] S150. Obtain the page display information corresponding to the currently displayed page, the page display information including the invoice information and the goods details information.
[0045] In this embodiment, after adjusting the display parameters of the current page of the target terminal, the goods details window is spliced at the bottom of the invoice verification result page in the current display page, thereby enabling the simultaneous acquisition of invoice information and goods details information on the same page.
[0046] When the invoice verification result page returned by the invoice verification system already includes invoice information and corresponding goods details, the invoice verification result page will not include the goods details button, and the currently displayed page is the invoice verification result page.
[0047] In some embodiments, after obtaining the page display information corresponding to the currently displayed page, the method further includes:
[0048] Send the page display information to the remote server; send an invoice verification result retrieval request for the target invoice to the remote server; receive the page display information returned by the remote server based on the invoice verification result retrieval request.
[0049] As can be seen, through this embodiment, the obtained page display information can be sent to a remote server, so that users can obtain the corresponding information anytime and anywhere through different terminals. When users need to obtain page display information, they can request the corresponding page display information from the remote server.
[0050] In addition, in some embodiments, after obtaining the page display information corresponding to the currently displayed page, the page display information can also be stored locally.
[0051] In some embodiments, before displaying the invoice verification result page for the target invoice in response to an invoice verification request for the target invoice, the method further includes:
[0052] The method further includes: obtaining a total invoice verification request for multiple invoices to be verified; determining the target invoice from the multiple invoices to be verified; triggering the invoice verification request for the target invoice; after obtaining the page display information corresponding to the currently displayed page, the method further includes: updating one unprocessed invoice among the multiple invoices to be verified to the target invoice, and returning to the step of triggering the invoice verification request for the target invoice, until all the multiple invoices to be verified have been processed.
[0053] As can be seen, this embodiment can trigger multiple invoice verification operations for invoices to be verified through a single invoice verification request, thereby improving invoice verification efficiency.
[0054] In summary, this embodiment of the application automatically obtains the window position parameters corresponding to the goods details window when it detects that a hidden goods details window is detected in the invoice verification result page. Based on the window position parameters and the result page position parameters, it adjusts the current page display parameters so that the current display page simultaneously displays the invoice verification result page and the goods details window. The page display information (long screenshot or PDF) obtained through the current display page includes both invoice information and goods details information, making it convenient for users to view the complete information of the invoice, thereby improving the user experience.
[0055] Figure 2 This is a flowchart illustrating a method for obtaining webpage data according to another embodiment of this application. Figure 2 As shown, the method for obtaining web page data in this embodiment includes steps S210-S270.
[0056] S210. In response to an invoice verification request for a target invoice, display an invoice verification result page for the target invoice, the invoice verification result page including invoice information.
[0057] S220. Check if there is a goods details button on the invoice verification result page. If yes, proceed to step S230; otherwise, proceed to step S250.
[0058] S230. Click the goods details button to display the goods details window corresponding to the target invoice, so as to obtain the window position parameters corresponding to the goods details window. The goods details window includes goods details information.
[0059] S240. Adjust the current page display parameters according to the window position parameters and the result page position parameters corresponding to the invoice verification result page, so that the current display page of the target terminal simultaneously displays the invoice verification result page and the goods details window.
[0060] Steps S210-S240 are similar to steps S110-140 in the above embodiments, and will not be described again here.
[0061] S250. Determine whether the number of goods details in the goods details information is greater than a preset threshold; if yes, proceed to step S270; if no, proceed to step S260.
[0062] In this embodiment, for invoices with a large number of product details, taking long screenshots of the page can easily cause the browser to crash due to the excessive length of the webpage content, affecting the verification efficiency and potentially consuming valuable verification attempts due to multiple verifications.
[0063] Therefore, this application sets different methods for obtaining page display information based on the number of goods detail entries. Specifically, a number of goods detail entries is set, for example, 1000. If the number of goods detail entries in the goods detail window exceeds 1000, it is determined that the current webpage content is too long. To avoid browser crashes due to excessively long webpage content, the current display page is converted to PDF in step S270 to obtain the corresponding page display information. If the number of goods detail entries in the goods detail window does not exceed 1000, the page display information corresponding to the current display page is obtained through a long screenshot in step S260.
[0064] S260. Perform long screenshot processing on the currently displayed page to obtain a target long screenshot containing the invoice information and the goods details information.
[0065] Specifically, if the number of item details in the item details information is less than or equal to a preset threshold, then the page display information corresponding to the currently displayed page is obtained through a long screenshot. In some embodiments, Selenium obtains the target long screenshot through the following steps:
[0066] Obtain the screen parameters of the target terminal; perform adaptive scaling on the currently displayed page according to the screen parameters to obtain an adaptive page; perform long screenshot processing on the adaptive page to obtain the target long screenshot.
[0067] As can be seen, this embodiment can adaptively scale the currently displayed page, automatically adjusting its length and width to display all page information, thus ensuring the integrity of the content of the page to be captured. Furthermore, compared to screenshots that rely on continuous scrolling and stitching, long screenshots will not contain repetitive content, restoring the true website browsing experience and facilitating user viewing.
[0068] S270. Based on the source code of the currently displayed page, perform PDF conversion processing on the currently displayed page to obtain a target PDF containing the invoice information and the goods details information.
[0069] Specifically, if the number of item details in the item details information exceeds a preset threshold, it is necessary to obtain the page display information corresponding to the currently displayed page by performing a PDF conversion on the currently displayed page. In some embodiments, the target PDF is obtained through the following steps:
[0070] The CSS file access path in the page source code is adjusted to an absolute path to obtain the processed webpage source code; the processed webpage source code is then converted into the target PDF using a preset PDF conversion tool.
[0071] The default PDF conversion tool is wkhtmltopdf (an HTML to PDF tool). In this embodiment, before performing PDF conversion, the access path of the CSS file in the page source code is first adjusted to an absolute path to ensure that the converted target PDF can retain the original style of the website and improve the user experience.
[0072] In some embodiments, after obtaining the page display information corresponding to the currently displayed page, the method further includes:
[0073] Send the page display information to the remote server; send an invoice verification result retrieval request for the target invoice to the remote server; receive the page display information returned by the remote server based on the invoice verification result retrieval request.
[0074] As can be seen, through this embodiment, the obtained page display information can be sent to a remote server, so that users can obtain the corresponding information anytime and anywhere through different terminals. When users need to obtain page display information, they can request the corresponding page display information from the remote server.
[0075] In addition, in some embodiments, after obtaining the page display information corresponding to the currently displayed page, the page display information can also be stored locally.
[0076] In some embodiments, before displaying the invoice verification result page for the target invoice in response to an invoice verification request for the target invoice, the method further includes:
[0077] The method further includes: obtaining a total invoice verification request for multiple invoices to be verified; determining the target invoice from the multiple invoices to be verified; triggering the invoice verification request for the target invoice; after obtaining the page display information corresponding to the currently displayed page, the method further includes: updating one unprocessed invoice among the multiple invoices to be verified to the target invoice, and returning to the step of triggering the invoice verification request for the target invoice, until all the multiple invoices to be verified have been processed.
[0078] As can be seen, this embodiment can trigger multiple invoice verification operations for invoices to be verified through a single invoice verification request, thereby improving invoice verification efficiency.
[0079] In summary, this embodiment of the application automatically obtains the window position parameters corresponding to the goods details window when it detects that a hidden goods details window is detected in the invoice verification result page. Based on the window position parameters and the result page position parameters, it adjusts the current page display parameters so that the current display page simultaneously displays the invoice verification result page and the goods details window. The page display information (long screenshot or PDF) obtained through the current display page includes both invoice information and goods details information, making it convenient for users to view the complete information of the invoice, thereby improving the user experience.
[0080] Figure 3 This is a schematic block diagram of a web page data acquisition device 300 provided in an embodiment of this application. Figure 3 As shown, corresponding to the above-described method for acquiring webpage data, this application also provides a webpage data acquisition device 300. This webpage data acquisition device 300 includes a unit for performing the above-described method for acquiring webpage data, and can be configured in terminals such as desktop computers, tablet computers, and laptops. Specifically, please refer to... Figure 3 The webpage data acquisition device 300 includes a transceiver unit 301 and a processing unit 302.
[0081] The receiving and sending unit 301 is used to obtain the invoice verification request for the target invoice;
[0082] Processing unit 302 is configured to, in response to an invoice verification request for a target invoice, display an invoice verification result page for the target invoice, the invoice verification result page including invoice information; detect whether a goods details button exists on the invoice verification result page; if the goods details button exists, click the goods details button to display a goods details window corresponding to the target invoice, and obtain window position parameters corresponding to the goods details window, the goods details window including goods details information; adjust the current page display parameters according to the window position parameters and the result page position parameters corresponding to the invoice verification result page, so that the current display page of the target terminal simultaneously displays the invoice verification result page and the goods details window; and obtain page display information corresponding to the current display page, the page display information including the invoice information and the goods details information.
[0083] In some embodiments, when the processing unit 302 performs the step of obtaining the page display information corresponding to the currently displayed page, it is specifically used for:
[0084] Determine whether the number of goods detail entries in the goods detail information is greater than a preset threshold; if it is less than or equal to the preset threshold, perform long screenshot processing on the currently displayed page to obtain a target long screenshot containing the invoice information and the goods detail information; if it is greater than the preset threshold, perform PDF conversion processing on the currently displayed page according to the page source code of the currently displayed page to obtain a target PDF containing the invoice information and the goods detail information.
[0085] In some embodiments, when the processing unit 302 performs the step of taking a long screenshot of the currently displayed page to obtain a target long screenshot containing the invoice information and the goods details information, it is specifically used for:
[0086] Obtain the screen parameters of the target terminal; perform adaptive scaling on the currently displayed page according to the screen parameters to obtain an adaptive page; perform long screenshot processing on the adaptive page to obtain the target long screenshot.
[0087] In some embodiments, when the processing unit 302 performs the step of converting the currently displayed page to PDF based on the page source code of the currently displayed page to obtain a target PDF containing the invoice information and the goods details information, it is specifically used for:
[0088] The CSS file access path in the page source code is adjusted to an absolute path to obtain the processed webpage source code; the processed webpage source code is then converted into the target PDF using a preset PDF conversion tool.
[0089] In some embodiments, when the processing unit 302 performs the step of adjusting the current page display parameters according to the window position parameters and the result page position parameters corresponding to the invoice verification result page, it is specifically used for:
[0090] Obtain the result page position parameter; append the window position parameter to the bottom of the result page position parameter to adjust the current page display parameter.
[0091] In some embodiments, after the processing unit 302 performs the step of obtaining the page display information corresponding to the currently displayed page, the transceiver unit 301 is further configured to:
[0092] Send the page display information to the remote server; send an invoice verification result retrieval request for the target invoice to the remote server; receive the page display information returned by the remote server based on the invoice verification result retrieval request.
[0093] In some embodiments, before performing the step of displaying the invoice verification result page for the target invoice in response to the invoice verification request for the target invoice, the processing unit 302 is further configured to:
[0094] The transceiver unit 301 acquires a total invoice verification request for multiple invoices to be verified; determines the target invoice from the multiple invoices to be verified; and triggers the invoice verification request for the target invoice.
[0095] At this time, after performing the step of obtaining the page display information corresponding to the currently displayed page, the processing unit 302 is further configured to:
[0096] Update one of the pending invoices to the target invoice, and return to the step of triggering the invoice verification request for the target invoice, until all the pending invoices have been processed.
[0097] In summary, when the webpage data acquisition device 300 in this embodiment detects that a goods details window is hidden in the invoice verification result page, it automatically acquires the window position parameters corresponding to the goods details window, and adjusts the current page display parameters according to the window position parameters and the result page position parameters, so that the current display page displays both the invoice verification result page and the goods details window at the same time. The page display information (long screenshot or PDF) obtained through the current display page includes both invoice information and goods details information, making it convenient for users to view the complete information of the invoice, thereby improving the user experience.
[0098] It should be noted that those skilled in the art can clearly understand that the specific implementation process of the above-mentioned web page data acquisition device and each unit can be referred to the corresponding description in the foregoing method embodiments. For the sake of convenience and brevity, it will not be repeated here.
[0099] The aforementioned webpage data acquisition device can be implemented as a computer program, which can, for example... Figure 4 It runs on the target terminal shown.
[0100] Please see Figure 4 , Figure 4 This is a schematic block diagram of a target terminal provided in an embodiment of this application. The target terminal can be an electronic device with communication and display functions, such as a smartphone, tablet computer, laptop computer, or desktop computer.
[0101] See Figure 4 The target terminal 400 includes a processor 402, a memory, and a network interface 405 connected via a system bus 401. The memory may include a non-volatile storage medium 403 and internal memory 404.
[0102] The non-volatile storage medium 403 may store an operating system 4031 and a computer program 4032. The computer program 4032 includes program instructions that, when executed, cause the processor 402 to perform a method for acquiring web page data.
[0103] The processor 402 is used to provide computing and control capabilities to support the operation of the entire target terminal 400.
[0104] The internal memory 404 provides an environment for the execution of the computer program 4032 in the non-volatile storage medium 403. When the computer program 4032 is executed by the processor 402, the processor 402 can execute a method for acquiring web page data.
[0105] This network interface 405 is used for network communication with other devices. Those skilled in the art will understand that... Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the target terminal 400 to which the present application is applied. The specific target terminal 400 may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0106] The processor 402 is used to run a computer program 4032 stored in the memory to perform the following steps:
[0107] In response to an invoice verification request for a target invoice, an invoice verification result page for the target invoice is displayed, the invoice verification result page including invoice information;
[0108] Check if a "Goods Details" button exists on the invoice verification results page;
[0109] If the "Goods Details" button exists, clicking the "Goods Details" button will display the "Goods Details" window corresponding to the target invoice, so as to obtain the window position parameters corresponding to the "Goods Details" window. The "Goods Details" window includes goods details information.
[0110] The current page display parameters are adjusted according to the window position parameters and the result page position parameters corresponding to the invoice verification result page, so that the current display page of the target terminal simultaneously displays the invoice verification result page and the goods details window;
[0111] Obtain the page display information corresponding to the currently displayed page, the page display information including the invoice information and the goods details information.
[0112] It should be understood that in the embodiments of this application, the processor 402 may be a central processing unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.
[0113] It will be understood by those skilled in the art that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program includes program instructions and can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiments of the above methods.
[0114] Therefore, this application also provides a storage medium. This storage medium can be a computer-readable storage medium. The storage medium stores a computer program, wherein the computer program includes program instructions. When executed by a processor, the program instructions cause the processor to perform the following steps:
[0115] In response to an invoice verification request for a target invoice, an invoice verification result page for the target invoice is displayed, the invoice verification result page including invoice information;
[0116] Check if a "Goods Details" button exists on the invoice verification results page;
[0117] If the "Goods Details" button exists, clicking the "Goods Details" button will display the "Goods Details" window corresponding to the target invoice, so as to obtain the window position parameters corresponding to the "Goods Details" window. The "Goods Details" window includes goods details information.
[0118] The current page display parameters are adjusted according to the window position parameters and the result page position parameters corresponding to the invoice verification result page, so that the current display page of the target terminal simultaneously displays the invoice verification result page and the goods details window;
[0119] Obtain the page display information corresponding to the currently displayed page, the page display information including the invoice information and the goods details information.
[0120] The storage medium can be any computer-readable storage medium capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory (ROM), magnetic disk, or optical disk.
[0121] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this application.
[0122] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For example, the division of each unit is merely a logical functional division, and there may be other division methods in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed.
[0123] The steps in the methods of this application embodiment can be adjusted, merged, or deleted according to actual needs. The units in the apparatus of this application embodiment can be merged, divided, or deleted according to actual needs. Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0124] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a terminal, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application.
[0125] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for acquiring webpage data, characterized in that, The method is applied to a target terminal, and the method includes: In response to an invoice verification request for a target invoice, an invoice verification result page for the target invoice is displayed, the invoice verification result page including invoice information; Check if a "Goods Details" button exists on the invoice verification results page; If the goods details button exists, then Selenium is used to simulate clicking the goods details button to display the goods details window corresponding to the target invoice, so as to obtain the window position parameters corresponding to the goods details window. The goods details window includes goods details information. The current page display parameters are adjusted according to the window position parameters and the result page position parameters corresponding to the invoice verification result page, so that the current display page of the target terminal simultaneously displays the invoice verification result page and the goods details window; Obtain the page display information corresponding to the currently displayed page, the page display information including the invoice information and the goods details information.
2. The method according to claim 1, characterized in that, The step of obtaining the page display information corresponding to the currently displayed page includes: Determine whether the number of goods details entries in the goods details information is greater than a preset threshold; If the value is less than or equal to the preset threshold, a long screenshot is taken of the currently displayed page to obtain a target long screenshot containing the invoice information and the goods details. If the value is greater than the preset threshold, the current display page is converted into a PDF based on the page source code of the current display page to obtain a target PDF containing the invoice information and the goods details information.
3. The method according to claim 2, characterized in that, The step of performing long screenshot processing on the currently displayed page to obtain a target long screenshot containing the invoice information and the goods details includes: Obtain the screen parameters of the target terminal; The currently displayed page is adaptively scaled according to the screen parameters to obtain an adaptive page; The adaptive page is processed into a long screenshot to obtain the target long screenshot.
4. The method according to claim 2, characterized in that, The step of performing PDF conversion on the currently displayed page based on the page source code to obtain a target PDF containing the invoice information and the goods details includes: Adjust the access path of the CSS file in the page source code to an absolute path to obtain the processed web page source code. The processed webpage source code is converted into the target PDF using a preset PDF conversion tool.
5. The method according to claim 1, characterized in that, The step of adjusting the current page display parameters according to the window position parameters and the corresponding result page position parameters of the invoice verification result page includes: Obtain the result page position parameter; The window position parameter is appended to the bottom of the result page position parameter to adjust the current page display parameter.
6. The method according to claim 1, characterized in that, After obtaining the page display information corresponding to the currently displayed page, the method further includes: Send the page display information to a remote server; Send an invoice verification result retrieval request for the target invoice to the remote server; Receive the page display information returned by the remote server based on the invoice verification result request.
7. The method according to any one of claims 1 to 6, characterized in that, Before displaying the invoice verification result page for the target invoice in response to an invoice verification request for the target invoice, the method further includes: Retrieve the total invoice verification request for multiple invoices pending verification; The target invoice is determined from a plurality of the invoices to be inspected; Trigger an invoice verification request for the target invoice; After obtaining the page display information corresponding to the currently displayed page, the method further includes: Update one of the multiple unprocessed invoices to be verified to the target invoice, and return to the step of triggering the invoice verification request for the target invoice, until all the multiple invoices to be verified have been processed.
8. A device for acquiring webpage data, characterized in that, The webpage data acquisition device is deployed on the target terminal and includes: The sending and receiving unit is used to obtain the invoice verification request for the target invoice; The processing unit is configured to respond to an invoice verification request for a target invoice by displaying an invoice verification result page for the target invoice, the invoice verification result page including invoice information; detecting whether a goods details button exists on the invoice verification result page; if the goods details button exists, simulating a click on the goods details button using Selenium to display the goods details window corresponding to the target invoice, and obtaining window position parameters corresponding to the goods details window, the goods details window including goods details information; adjusting the current page display parameters according to the window position parameters and the result page position parameters corresponding to the invoice verification result page, so that the current display page of the target terminal simultaneously displays the invoice verification result page and the goods details window; and obtaining page display information corresponding to the current display page, the page display information including the invoice information and the goods details information.
9. A target terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method for acquiring web page data as described in any one of claims 1-7.
10. A storage medium, characterized in that, The storage medium stores a computer program, which includes program instructions that, when executed by a processor, cause the processor to perform the web page data acquisition method as described in any one of claims 1-7.
Citation Information
Patent Citations
Electronic invoice receiving and checking method and system
CN111737967A
Invoice crawler checking method and device, computer equipment and storage medium
CN113536091A