Webpage table data acquisition method and device, computer device and storage medium

By obtaining file tag information and identifier conversion of web page tables, the problem of inconsistent formatting after copying non-table tag table data was solved, achieving fast and efficient data acquisition.

CN116167346BActive Publication Date: 2026-07-10SHENZHEN KEMAI TECH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHENZHEN KEMAI TECH
Filing Date
2022-12-06
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

When users copy table content (not created using the `

` tag) from their browser to data visualization software, the original display format cannot be maintained, making the data retrieval process cumbersome and reducing the speed of retrieving table data from web pages.

Method used

By obtaining the file tag information of the target webpage, the preset mark position of the table data is determined and an identifier is set. User operations are monitored to obtain the table data to be processed. The format is converted according to the identifier and the identifier of the target display software to generate target table data that conforms to the display software format.

Benefits of technology

It effectively reduces the complexity of data acquisition, improves the speed of users acquiring webpage table data, and ensures that the original table data display format is maintained in the target display software.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116167346B_ABST
    Figure CN116167346B_ABST
Patent Text Reader

Abstract

The application relates to a webpage table data acquisition method and device, computer equipment, a storage medium and a computer program product. The method comprises the following steps: acquiring file label information of a target webpage browsed by a user; determining a preset mark position of table data in the target webpage according to the file label information, and setting an identifier at the preset mark position; when it is detected that the user triggers a table data acquisition operation in the target webpage, acquiring selected to-be-processed table data, the to-be-processed table data containing the identifier; and performing format conversion on the to-be-processed table data according to the identifier and a target identifier of target display software, so as to obtain target table data. The method can reduce the complexity of data acquisition and improve the webpage table data acquisition speed of the user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of Internet technology, and in particular to a method, apparatus, computer device, storage medium, and computer program product for obtaining web page table data. Background Technology

[0002] With the rapid development of internet technology, the internet has become an important source of information management and acquisition for people. People often browse web pages and copy data from them to reduce repetitive work in data acquisition.

[0003] When users copy the table content retrieved from their browser into their data visualization software, such as an Excel spreadsheet, if the browser's table is developed using a non-table tag, the copied content will not be displayed in the user's data visualization software according to the display format on the webpage. Users will need to readjust the copied content in the data visualization software, making the entire data acquisition process cumbersome and reducing the speed at which users obtain webpage table data. Summary of the Invention

[0004] Therefore, it is necessary to provide a web page table data acquisition method, apparatus, computer equipment, computer-readable storage medium, and computer program product that can reduce the cumbersomeness of data acquisition and improve the speed of users acquiring web page table data, in order to address the above-mentioned technical problems.

[0005] Firstly, this application provides a method for obtaining webpage table data, the method comprising:

[0006] Obtain the file tag information of the target webpage browsed by the user;

[0007] Determine the preset marker position of the table data in the target webpage based on the file tag information, and set an identifier at the preset marker position;

[0008] When the user triggers a table data retrieval operation on the target webpage, the user selects the table data to be processed, which contains the identifier.

[0009] Based on the identifier and the target identifier of the target display software, the format of the table data to be processed is converted to obtain the target table data.

[0010] In one embodiment, the preset marker position includes the cell position and row position of the table in the target webpage;

[0011] The step of determining the preset marker position of the table data in the target webpage based on the file tag information, and setting an identifier at the preset marker position, includes:

[0012] The file tag information is found based on preset cell position tags and preset row position tags;

[0013] Set a cell identifier at the file label location in the table data that matches the preset cell location label;

[0014] Set a row identifier at the file label in the table data that matches the preset row position label.

[0015] In one embodiment, the step of converting the format of the table data to be processed based on the identifier and the target identifier of the target display software to obtain the target table data includes:

[0016] The table data to be processed is converted to obtain a table data string;

[0017] Obtain the target cell identifier and target row position identifier from the target display software;

[0018] Replace the cell identifier in the table data string with the target cell identifier, and replace the row position identifier with the target row position identifier to obtain the target table data string;

[0019] The target table data string is reverse-converted to obtain the target table data.

[0020] In one embodiment, the step of converting the data format of the table data to be processed to obtain a table data string includes:

[0021] The data format of the table to be processed is converted to obtain a data string;

[0022] Determine whether there are any unnecessary identifiers in the data string;

[0023] If unnecessary identifiers exist, filter them to obtain the table data string.

[0024] In one embodiment, determining whether there are unnecessary identifiers in the data string includes:

[0025] Obtain the browser currently being used by the target webpage;

[0026] If the browser is one of the browsers in the preset browser list, then it is determined that there are unnecessary identifiers in the data string.

[0027] In one embodiment, the method further includes:

[0028] The target table data is sent to a preset acquisition path, which is used to respond to the user's data transfer operation and display the target table data in the target display software.

[0029] Secondly, this application also provides a webpage table data acquisition device, the device comprising:

[0030] The tag information acquisition module is used to acquire the file tag information of the target webpage browsed by the user;

[0031] The marker position determination module is used to determine the preset marker position of the table data in the target webpage based on the file tag information, and set an identifier at the preset marker position;

[0032] The pending data acquisition module is used to acquire the pending table data selected by the user when the user triggers a table data acquisition operation on the target webpage. The pending table data contains the identifier.

[0033] The data processing module is used to convert the format of the table data to be processed according to the identifier and the target identifier of the target display software to obtain the target table data.

[0034] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the above-described method.

[0035] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described method.

[0036] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described method.

[0037] The aforementioned method, apparatus, computer equipment, storage medium, and computer program product for acquiring webpage table data obtains file tag information of the target webpage browsed by the user. Based on the file tag information, it determines the preset marker position of the table data in the target webpage. This preset marker position allows for the determination of the table data's location within the target webpage table during subsequent format conversion. When a user triggers a table data acquisition operation on the target webpage, it acquires the user-selected table data to be processed. Based on the identifier contained in the table data to be processed and the target identifier of the target display software, it performs format conversion on the table data to be processed, obtaining target table data that conforms to the display format of the target display software. This avoids the inability to display table data according to the table display format on the target webpage in the target display software, effectively reducing the cumbersomeness of data acquisition and improving the speed of acquiring webpage table data for the user. Attached Figure Description

[0038] Figure 1 This is an application environment diagram of a webpage table data acquisition method in one embodiment;

[0039] Figure 2 This is a flowchart illustrating a method for obtaining table data from a webpage in one embodiment;

[0040] Figure 3 This is a flowchart illustrating the step of determining the preset marker position of table data in a target webpage based on file tag information and setting an identifier at the preset marker position in one embodiment.

[0041] Figure 4 This is a flowchart illustrating the steps in one embodiment of converting the format of the table data to be processed based on the identifier and the target identifier of the target display software to obtain the target table data.

[0042] Figure 5 This is a flowchart illustrating the steps of converting the data format of the table data to be processed into a table data string in one embodiment.

[0043] Figure 6 This is a flowchart illustrating a method for obtaining webpage table data in another embodiment;

[0044] Figure 7 This is a flowchart illustrating the method for obtaining table data from a webpage in yet another embodiment;

[0045] Figure 8 This is a structural block diagram of a webpage table data acquisition device in one embodiment;

[0046] Figure 9 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0047] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0048] The webpage table data acquisition method provided in this application embodiment can be applied to, for example... Figure 1 In the application environment shown, the data processing component 102 communicates with the server 104 via a network. A data storage system can store the data that the data processing component 102 needs to process. The data storage system can be integrated into the data processing component 102 or placed in the cloud or on another network server. The data processing component 102 obtains file tag information of the target webpage browsed by the user from the server 104, determines the preset marker position of the table data in the target webpage based on the file tag information, and sets an identifier at the preset marker position. When the user triggers a table data retrieval operation on the target webpage, the component obtains the table data to be processed selected by the user. The table data to be processed contains an identifier. Based on the identifier and the target identifier of the target display software, the component performs format conversion on the table data to be processed to obtain the target table data. The data processing component 102 is integrated into the user terminal, which can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. Portable wearable devices can be smartwatches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented using a standalone server or a server cluster composed of multiple servers.

[0049] In one embodiment, such as Figure 2 As shown, a method for obtaining table data from a webpage is provided, which can be applied to... Figure 1 Taking the data processing component in the example, the following steps are included:

[0050] Step 202: Obtain the file tag information of the target webpage browsed by the user.

[0051] In this context, the target webpage refers to the webpage the user is currently browsing. Specifically, each page in the browser window can be considered an object, and the document object represents the HTML document displayed in the browser window, containing all the content of the webpage. The document object contains many attributes, such as tag names, node types, values, node content, and collections of node objects. By manipulating these attributes, the document's content can be accessed or modified. The method of accessing and modifying the document object is called the Document Object Model (DOM).

[0052] Understandably, the target webpage is a webpage where the document object is pre-configured according to configuration rules, and the attribute information of the document object is modified by the designer according to the user's actual usage needs, such as project requirements and business requirements.

[0053] Among them, file tag information is a collection of tag information describing page content in the document object attribute information. All tags of page content can be considered DOM elements. Tags include, but are not limited to, tags describing titles and page summary information, such as <title>, <meta>, etc.; tags that plan page layout, such as , , , , , etc., which describe the layout structure of web page content; tags that describe display characteristics, such as , , <strong>, -<h6>, etc., which emphasize key content and attract attention; and hyperlink-related tags, which indicate the content relevance between web pages, etc.<h1>

[0054] Specifically, when a user browses a webpage using a browser on their terminal, the data processing component performs initialization operations on the webpage the user is currently browsing and obtains the file tag information of the target webpage the user is browsing.

[0055] Step 204: Determine the preset mark position of the table data in the target webpage based on the file tag information, and set the identifier at the preset mark position.

[0056] The preset marker position is used to determine the location of table data within the table on the target webpage. Setting identifiers at preset marker positions allows for quick determination of the table data's position during subsequent format conversions, preventing discrepancies between the data's location displayed in the target display software and its actual position on the target webpage. Identifiers can be any type of marking symbol or placeholders. The number of preset marker positions and identifiers, as well as their specific settings, are determined by the designer when configuring the document object of the target webpage.

[0057] Specifically, the data processing component searches for attribute elements based on the obtained file tag information, determines the tag attribute that matches the preset tag attribute at the preset mark position as the target tag attribute, determines the position corresponding to the target tag attribute as the preset mark position, and sets the corresponding identifier at the preset mark position.

[0058] For example, designers pre-configure the document object attribute information for the target webpage. The designers designate the places in the target webpage where tables need to be formatted as preset mark positions and set the attribute name of the preset mark position as preset tag attribute A. When a user browses the target webpage, the data processing component obtains the file tag information of the target webpage, determines the target tag attribute from the file tag information and the tag attribute with tag attribute A, and sets the corresponding identifier at the corresponding position.

[0059] Step 206: When the user triggers a table data retrieval operation on the target webpage, the user-selected table data to be processed is retrieved. The table data to be processed contains an identifier.

[0060] Specifically, the data component is equipped with a copy listener event. When it detects that a user has triggered a table data retrieval operation on the target webpage, it retrieves the table data selected by the user. This table data contains identifiers that the data component pre-set at preset marker positions during initialization. It can be understood that the table data to be processed can be the table data of all tables on the target webpage, the table data of a specific table on the target webpage, or a portion of the table data from a specific table on the target webpage.

[0061] Step 208: Based on the identifier and the target identifier of the target display software, perform format conversion on the table data to be processed to obtain the target table data.

[0062] Among them, target display software is software used to re-display table data for users. Target display software can be public office software, such as Excel, Word, etc., or private office software used internally by users, such as display software with customizable templates.

[0063] The target display software comes with specific format identifiers, which can be used to display the input data in the target display software according to the corresponding format.

[0064] Specifically, after the data processing component obtains the table data to be processed, it replaces the identifiers contained in the table data with the target identifier, performs format conversion on the table data to obtain the target table data, and the target display software displays the target table data. The display format of the table data on the target page can be retained in the target display software.

[0065] In the above-described method for obtaining webpage table data, the file tag information of the target webpage browsed by the user is obtained. Based on the file tag information, the preset marker position of the table data in the target webpage is determined. The preset marker position can be used to determine the position of the table data in the table of the target webpage during subsequent format conversion. When the user triggers a table data acquisition operation on the target webpage, the table data to be processed selected by the user is obtained. Based on the identifier contained in the table data to be processed and the target identifier of the target display software, the table data to be processed is format converted to obtain target table data that conforms to the display format of the target display software. This avoids the problem of the table data not being displayed in the target display software according to the display format of the table on the target webpage, effectively reducing the cumbersomeness of data acquisition and improving the speed of obtaining webpage table data for users.

[0066] In one embodiment, the preset marker positions include the cell and row positions of a table on the target webpage. For example... Figure 3 As shown, the preset marker positions for table data in the target webpage are determined based on file tag information, and identifiers are set at the preset marker positions, including:

[0067] Step 302: Find the file tag information based on the preset cell position tags and preset row position tags.

[0068] Specifically, since a table consists of multiple rows of cells, determining the cell and row positions of the table data within the table determines its exact location within the table. Designers pre-determine the positions of the end of the cells and the end of the rows in the target page as preset marker positions, and then set preset cell position labels and preset row position labels for these preset marker positions.

[0069] After obtaining the file tag information of the target webpage browsed by the user, the data processing component searches for the file tag information based on the preset cell position tags and preset row position tags.

[0070] Step 304: Set the cell identifier at the file label in the table data that matches the preset cell position label.

[0071] Specifically, the data processing component determines the file tag attribute in the file tag information that matches the preset cell position tag attribute as the target cell tag attribute, and sets a cell identifier at the position of the table data corresponding to the target cell tag attribute. The cell identifier is used to locate the cell position of the table data in the table.

[0072] Step 306: Set a row identifier at the file label in the table data that matches the preset row position label.

[0073] Specifically, the data processing component determines the file tag attribute that matches the preset row position tag attribute in the file tag information as the target row tag attribute, and sets a row identifier at the position of the table data corresponding to the target row tag attribute. The row identifier is used to locate the row position of the table data in the table.

[0074] In this embodiment, by pre-marking the cell and row positions of the table data in the target webpage, during subsequent format conversion, the target table data can be converted to be consistent with the display format of the table data in the target webpage based on the pre-marked cell and row positions. This avoids the inability to display the table data in the target display software according to the display format of the table in the target webpage, effectively reducing the cumbersomeness of data acquisition and improving the speed of users acquiring webpage table data.

[0075] In one embodiment, such as Figure 4 As shown, based on the identifier and the target identifier of the target display software, the format of the table data to be processed is converted to obtain the target table data, including:

[0076] Step 402: Convert the data format of the table data to be processed to obtain the table data string.

[0077] Specifically, the data processing component converts the user-obtained table data into a table data string.

[0078] Step 404: Obtain the target cell identifier and target row position identifier of the target display software.

[0079] In this context, the target cell identifier is a placeholder used in the target display software to distinguish cell positions, and the target row position identifier is a placeholder used in the target display software to distinguish row positions. Taking an Excel spreadsheet as an example, since Excel uses \t to distinguish individual cells, \t can be used as the target cell identifier; and since Excel uses \n to convert rows, \n can be used as the target row position identifier.

[0080] Specifically, the data processing component obtains the target cell identifier and target row position identifier of the target display software. Understandably, the data processing component stores multiple target identifiers for display software, and the user can select the target identifier of the corresponding target display software according to their needs.

[0081] Step 406: Replace the cell identifiers in the table data string with the target cell identifiers and the row position identifiers with the target row position identifiers to obtain the target table data string.

[0082] Specifically, the data processing component replaces the cell identifiers in the table data string with the target cell identifiers and the row position identifiers with the target row position identifiers to obtain the target table data string, which contains the target cell identifiers and target row position identifiers corresponding to the target display software.

[0083] Step 408: Perform reverse data format conversion on the target table data string to obtain the target table data.

[0084] Specifically, the data processing component performs a reverse data format conversion on the target table data string, which contains the target cell identifier and the target row position identifier corresponding to the target display software, to obtain the target table data.

[0085] In this embodiment, the table data to be processed is converted into a table data string. This allows the cell identifiers and target row position identifiers in the table data to be replaced with the target cell identifiers and target row position identifiers of the target display software, resulting in a target table data string. Then, the target table data string undergoes a reverse data format conversion to convert it into target table data that can be displayed in the target display software. This avoids the inability to display the table data in the target display software according to the table display format of the target webpage, effectively reducing the cumbersomeness of data acquisition and improving the speed of obtaining table data from the user's webpage.

[0086] Because users may obtain redundant identifiers from certain web pages when retrieving table data to be processed, in one embodiment, to avoid these redundant identifiers affecting subsequent format conversion, such as... Figure 5 As shown, the data format of the table data to be processed is converted to obtain the table data string, including:

[0087] Step 502: Convert the data format of the table data to be processed to obtain a data string.

[0088] Specifically, the data processing component performs data format conversion on the table data to be processed, and uses the converted string as the data string.

[0089] Step 504: Determine whether there are unnecessary identifiers in the data string.

[0090] Specifically, the data processing component compares the data string with identifiers. If the data string contains identifiers other than the preset cell identifiers and row identifiers, it is determined that there are unnecessary identifiers in the data string.

[0091] Step 506: If there are unnecessary identifiers, filter them to obtain the table data string.

[0092] Specifically, after the data processing component determines that there are unnecessary identifiers in the data string, it filters out the unnecessary identifiers and removes the redundant unnecessary identifiers from the data string to obtain the table data string.

[0093] In one embodiment, if there is no unnecessary identifier, the data processing component determines the current data string as a table data string and performs subsequent identifier replacement operations.

[0094] In the above embodiments, by detecting unnecessary identifiers in the data string obtained after converting the table data to be processed, and when it is determined that there are unnecessary identifiers in the data string, the unnecessary identifiers are filtered in time to obtain the filtered table data string. This effectively avoids the consequence that the table data obtained by the user cannot be displayed on the target display software in accordance with the table display format of the target webpage due to unnecessary identifiers, thereby reducing the cumbersomeness of data acquisition and improving the speed of obtaining table data from the webpage for the user.

[0095] Furthermore, to improve the filtering speed of unnecessary identifiers, in one embodiment, determining whether there are unnecessary identifiers in the data string includes: obtaining the browser currently used by the target webpage; if the browser is a browser in a preset browser list, then it is determined that there are unnecessary identifiers in the data string.

[0096] The browser can be categorized as a standard browser or a non-standard browser based on the presence of unnecessary identifiers in the obtained table data. If a user uses a standard browser to browse the target webpage and obtain the table data, the obtained table data will not contain unnecessary identifiers. Conversely, if a user uses a non-standard browser to browse the target webpage and obtain the table data, the obtained table data will contain unnecessary identifiers. A default browser list stores the identification information for non-standard browsers.

[0097] Specifically, the data processing component obtains the browser currently used by the target webpage from the server, queries the identification information of each non-standard browser in the preset browser list based on the browser identification information, and if it is determined that the browser currently used by the target webpage is a browser in the preset browser list, it is determined that there are unnecessary identifiers in the data string, and subsequent filtering operations are performed.

[0098] If it is determined that the browser currently used by the target webpage is not a non-standard browser from the preset browser list, it means that there will be no unnecessary identifiers in the table data to be processed obtained by the user. The data processing component can directly determine the current data string as the table data string and perform subsequent identifier replacement operations.

[0099] In this embodiment, a preset browser list is generated in advance based on browsers that may generate unnecessary identifiers. When it is necessary to determine unnecessary identifiers, it is only necessary to obtain the browser of the target webpage browsed by the user and compare the browser with the preset browser list to quickly determine whether there are unnecessary identifiers in the table data to be processed. There is no need to traverse the data string to search for identifiers, which effectively reduces the speed of determining unnecessary identifiers and thus improves the filtering speed of unnecessary identifiers.

[0100] Furthermore, in one embodiment, such as Figure 6 As shown, a method for obtaining table data from a webpage is provided, including the following steps:

[0101] Step 602: Obtain the file tag information of the target webpage browsed by the user.

[0102] Step 604: Determine the preset mark position of the table data in the target webpage based on the file tag information, and set the identifier at the preset mark position.

[0103] Step 606: When the user triggers a table data retrieval operation on the target webpage, the user-selected table data to be processed is retrieved. The table data to be processed contains an identifier.

[0104] Step 608: Based on the identifier and the target identifier of the target display software, perform format conversion on the table data to be processed to obtain the target table data.

[0105] Specifically, the specific implementation methods of steps 602 to 608 are basically the same as those of steps 202 to 208, and will not be described again here.

[0106] Step 610: Send the target table data to the preset acquisition path. The preset acquisition path is used to respond to the user's data transfer operation and display the target table data in the target display software.

[0107] The preset acquisition path refers to the intermediate platforms that a user passes through when transferring the data they need to the target display platform. Examples include the clipboard.

[0108] Specifically, after acquiring the target table data, the data processing component sends the target table data to a preset acquisition path. The user then retrieves the format-converted target table data based on the preset acquisition path and adds the target table data to the target display software for display. The entire data conversion process does not require any additional adjustments from the user, effectively reducing the cumbersomeness of data acquisition and improving the speed at which users can obtain table data from web pages.

[0109] When users need to copy data from a webpage table, they often directly copy the table content found in the browser into their own Excel spreadsheet. However, when encountering tables developed using non-table tags, the copied content is not formatted correctly when pasted into Excel.

[0110] Based on this, in one embodiment, such as Figure 7 As shown, a method for obtaining table data from a webpage is provided. Taking Excel as the target display software, the method is illustrated in the following steps:

[0111] First, the data processing component obtains the page information of the user's currently viewed page and determines whether the currently viewed page is a page generated from a native table. If so, it means that the user can directly obtain the target table data from the page, put the target table data into the clipboard, and then paste it into Excel for display. The display format is consistent with the table display format on the webpage, and there will be no display confusion.

[0112] If the current page is not generated from a native table, it means that the current page is a target webpage pre-configured by the designer. The data processing component obtains the file tag information from the target webpage, traverses the table DOM elements in the file tag information, determines the end of the cells and the end of the rows in the target webpage table, adds cell placeholders to the end of the cells, and adds row placeholders to the end of the rows.

[0113] The data processing component adds a copy listener event. When it detects that the user has triggered a table data retrieval operation on the target webpage, it retrieves the copied object from the clipboard, converts the copied object into a string, and uses cell placeholders to distinguish cells and row placeholders to distinguish rows.

[0114] The data processing component determines whether the user's current browser is a standard browser. If not, it filters out redundant placeholders in the string, such as \r carriage return and \n line feed characters, to obtain the table data string. Since Excel uses \t to distinguish individual cells, it replaces cell placeholders with \t and row placeholders with \n in the table data string to obtain the target table data string. If the user's current browser is a standard browser, it directly identifies the string as the table data string and performs subsequent replacement operations.

[0115] Convert the target table data string to the format required by the clipboard to obtain the target table data. Then, reassign the target table data to the clipboard, waiting for the user to paste the target table data from the clipboard into an Excel spreadsheet for display.

[0116] The webpage table data acquisition method in this embodiment solves the problem of formatting errors that occur when copying the content of a table (excluding the `` tag) from a browser and pasting it into an Excel file. This effectively reduces the tediousness of data acquisition and improves the speed at which users can acquire webpage table data.

[0117] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0118] Based on the same inventive concept, this application also provides a webpage table data acquisition device for implementing the webpage table data acquisition method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations in one or more embodiments of the webpage table data acquisition device provided below can be found in the limitations of the webpage table data acquisition method described above, and will not be repeated here.

[0119] In one embodiment, such as Figure 8 As shown, a webpage table data acquisition device 800 is provided, including: a tag information acquisition module 801, a tag position determination module 802, a data to be processed acquisition module 803, and a data processing module 804, wherein:

[0120] The tag information acquisition module 801 is used to acquire the file tag information of the target webpage browsed by the user.

[0121] The marker position determination module 802 is used to determine the preset marker position of the table data in the target webpage based on the file tag information, and set an identifier at the preset marker position.

[0122] The pending data acquisition module 803 is used to acquire the pending table data selected by the user when the user triggers a table data acquisition operation on the target webpage. The pending table data contains an identifier.

[0123] The data processing module 804 is used to convert the format of the table data to be processed according to the identifier and the target identifier of the target display software to obtain the target table data.

[0124] The aforementioned webpage table data acquisition device acquires file tag information of the target webpage browsed by the user, determines the preset marker position of the table data in the target webpage based on the file tag information, and uses the preset marker position to determine the position of the table data in the table of the target webpage during subsequent format conversion. When the user triggers a table data acquisition operation on the target webpage, the device acquires the table data to be processed selected by the user, and performs format conversion on the table data to be processed based on the identifier contained in the table data to be processed and the target identifier of the target display software. This yields target table data that conforms to the display format of the target display software, avoiding the inability to display table data in the target display software according to the display format of the table in the target webpage, effectively reducing the cumbersomeness of data acquisition, and improving the speed of acquiring webpage table data for the user.

[0125] In one embodiment, the marker location determination module is further configured to: find file tag information based on preset cell location labels and preset row location labels; set cell identifiers at file tags in the table data that match the preset cell location labels; and set row identifiers at file tags in the table data that match the preset row location labels.

[0126] In one embodiment, the data processing module is further configured to: perform data format conversion on the table data to be processed to obtain a table data string; obtain the target cell identifier and the target row position identifier of the target display software; replace the cell identifier in the table data string with the target cell identifier and replace the row position identifier with the target row position identifier to obtain a target table data string; and perform reverse data format conversion on the target table data string to obtain the target table data.

[0127] In one embodiment, the data processing module is further configured to: perform data format conversion on the table data to be processed to obtain a data string; determine whether there are unnecessary identifiers in the data string; and if there are unnecessary identifiers, perform a filtering operation on the unnecessary identifiers to obtain the table data string.

[0128] In one embodiment, the data processing module is further configured to: obtain the browser currently used by the target webpage; if the browser is a browser in a preset browser list, determine that there are unnecessary identifiers in the data string.

[0129] In one embodiment, the webpage table data acquisition device further includes a target table data display module, which is used to send the target table data to a preset acquisition path, wherein the preset acquisition path is used to respond to the user's data transfer operation and display the target table data in the target display software.

[0130] Each module in the aforementioned webpage table data acquisition device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0131] In one embodiment, a computer device is provided, which may be a terminal integrating data processing components, and its internal structure diagram may be as follows: Figure 9 As shown, the computer device includes a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When executed by the processor, the computer program implements a method for retrieving web page table data. The display screen can be an LCD screen or an e-ink display screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the computer device casing, or an external keyboard, touchpad, or mouse.

[0132] Those skilled in the art will understand that Figure 9 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 computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0133] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0134] Obtain the file tag information of the target webpage browsed by the user;

[0135] Determine the preset marker positions for table data in the target webpage based on the file tag information, and set identifiers at the preset marker positions;

[0136] When a user triggers a table data retrieval operation on the target webpage, the user-selected table data to be processed is retrieved. The table data to be processed contains an identifier.

[0137] Based on the identifier and the target identifier of the target display software, the format of the table data to be processed is converted to obtain the target table data.

[0138] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0139] Find file tag information based on preset cell position tags and preset row position tags;

[0140] Set the cell identifier at the file label location in the table data that matches the preset cell location label;

[0141] Set the row identifier at the file label in the table data that matches the preset row position label.

[0142] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0143] Convert the data format of the table data to be processed to obtain the table data string;

[0144] Obtain the target cell identifier and target row position identifier from the target display software;

[0145] Replace the cell identifiers in the table data string with the target cell identifiers, and replace the row position identifiers with the target row position identifiers to obtain the target table data string;

[0146] Perform a reverse data format conversion on the target table data string to obtain the target table data.

[0147] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0148] Convert the data format of the table data to be processed to obtain a data string;

[0149] Determine if unnecessary identifiers exist in the data string;

[0150] If unnecessary identifiers exist, filter them to obtain the table data string.

[0151] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0152] Get the browser currently being used by the target webpage;

[0153] If the browser is one of the browsers in the preset browser list, then it is determined that there are unnecessary identifiers in the data string.

[0154] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0155] The target table data is sent to the preset acquisition path, which is used to respond to the user's data transfer operation and display the target table data in the target display software.

[0156] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:

[0157] Obtain the file tag information of the target webpage browsed by the user;

[0158] Determine the preset marker positions for table data in the target webpage based on the file tag information, and set identifiers at the preset marker positions;

[0159] When a user triggers a table data retrieval operation on the target webpage, the user-selected table data to be processed is retrieved. The table data to be processed contains an identifier.

[0160] Based on the identifier and the target identifier of the target display software, the format of the table data to be processed is converted to obtain the target table data.

[0161] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0162] Find file tag information based on preset cell position tags and preset row position tags;

[0163] Set the cell identifier at the file label location in the table data that matches the preset cell location label;

[0164] Set the row identifier at the file label in the table data that matches the preset row position label.

[0165] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0166] Convert the data format of the table data to be processed to obtain the table data string;

[0167] Obtain the target cell identifier and target row position identifier from the target display software;

[0168] Replace the cell identifiers in the table data string with the target cell identifiers, and replace the row position identifiers with the target row position identifiers to obtain the target table data string;

[0169] Perform a reverse data format conversion on the target table data string to obtain the target table data.

[0170] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0171] Convert the data format of the table data to be processed to obtain a data string;

[0172] Determine if unnecessary identifiers exist in the data string;

[0173] If unnecessary identifiers exist, filter them to obtain the table data string.

[0174] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0175] Get the browser currently being used by the target webpage;

[0176] If the browser is one of the browsers in the preset browser list, then it is determined that there are unnecessary identifiers in the data string.

[0177] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0178] The target table data is sent to the preset acquisition path, which is used to respond to the user's data transfer operation and display the target table data in the target display software.

[0179] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:

[0180] Obtain the file tag information of the target webpage browsed by the user;

[0181] Determine the preset marker positions for table data in the target webpage based on the file tag information, and set identifiers at the preset marker positions;

[0182] When a user triggers a table data retrieval operation on the target webpage, the user-selected table data to be processed is retrieved. The table data to be processed contains an identifier.

[0183] Based on the identifier and the target identifier of the target display software, the format of the table data to be processed is converted to obtain the target table data.

[0184] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0185] Find file tag information based on preset cell position tags and preset row position tags;

[0186] Set the cell identifier at the file label location in the table data that matches the preset cell location label;

[0187] Set the row identifier at the file label in the table data that matches the preset row position label.

[0188] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0189] Convert the data format of the table data to be processed to obtain the table data string;

[0190] Obtain the target cell identifier and target row position identifier from the target display software;

[0191] Replace the cell identifiers in the table data string with the target cell identifiers, and replace the row position identifiers with the target row position identifiers to obtain the target table data string;

[0192] Perform a reverse data format conversion on the target table data string to obtain the target table data.

[0193] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0194] Convert the data format of the table data to be processed to obtain a data string;

[0195] Determine if unnecessary identifiers exist in the data string;

[0196] If unnecessary identifiers exist, filter them to obtain the table data string.

[0197] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0198] Get the browser currently being used by the target webpage;

[0199] If the browser is one of the browsers in the preset browser list, then it is determined that there are unnecessary identifiers in the data string.

[0200] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0201] The target table data is sent to the preset acquisition path, which is used to respond to the user's data transfer operation and display the target table data in the target display software.

[0202] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0203] Those skilled in the art will understand 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 can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0204] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0205] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method for obtaining table data from a webpage, characterized in that, The method includes: Obtain the file tag information of the target webpage browsed by the user; The file tag information is found based on preset cell position tags and preset row position tags; Set a cell identifier at the file label location in the table data that matches the preset cell location label; Set a row identifier at the file label in the table data that matches the preset row position label; When the user triggers a table data retrieval operation on the target webpage, the user selects the table data to be processed, which contains the identifier. Based on the identifier and the target identifier of the target display software, the format of the table data to be processed is converted to obtain the target table data.

2. The method according to claim 1, characterized in that, The step of converting the format of the table data to be processed according to the identifier and the target identifier of the target display software to obtain the target table data includes: The table data to be processed is converted to obtain a table data string; Obtain the target cell identifier and target row position identifier from the target display software; Replace the cell identifier in the table data string with the target cell identifier, and replace the row position identifier with the target row position identifier to obtain the target table data string; The target table data string is reverse-converted to obtain the target table data.

3. The method according to claim 2, characterized in that, The step of converting the data format of the table data to be processed to obtain a table data string includes: The data format of the table to be processed is converted to obtain a data string; Determine whether there are any unnecessary identifiers in the data string; If unnecessary identifiers exist, filter them to obtain the table data string.

4. The method according to claim 3, characterized in that, Determining whether there are unnecessary identifiers in the data string includes: Obtain the browser currently being used by the target webpage; If the browser is one of the browsers in the preset browser list, then it is determined that there are unnecessary identifiers in the data string.

5. The method according to any one of claims 1 to 4, characterized in that, The method further includes: The target table data is sent to a preset acquisition path, which is used to respond to the user's data transfer operation and display the target table data in the target display software.

6. A webpage table data acquisition device, characterized in that, The device includes: The tag information acquisition module is used to acquire the file tag information of the target webpage browsed by the user; The marker location determination module is used to find the file tag information based on preset cell location labels and preset row location labels; set cell identifiers at file tags in the table data that match the preset cell location labels; and set row identifiers at file tags in the table data that match the preset row location labels. The pending data acquisition module is used to acquire the pending table data selected by the user when the user triggers a table data acquisition operation on the target webpage. The pending table data contains the identifier. The data processing module is used to convert the format of the table data to be processed according to the identifier and the target identifier of the target display software to obtain the target table data.

7. The apparatus according to claim 6, characterized in that, The data processing module is used to: convert the data format of the table data to be processed to obtain a table data string; obtain the target cell identifier and the target row position identifier of the target display software; replace the cell identifier in the table data string with the target cell identifier and replace the row position identifier with the target row position identifier to obtain the target table data string; The target table data string is reverse-converted to obtain the target table data.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.