IP Library Granted Patent US 10,515,142
Granted Patent B2
US 10,515,142 · App. 15/183,069 · Granted Dec 24, 2019

Method and apparatus for extracting webpage information

Inventor: Ming Cai (Guangzhou, CN)
Assignee: GUANGZHOU UCWEB COMPUTER TECHNOLOGY CO., LTD
G06F17/2288G06F17/218G06F17/2247G06F17/272G06F17/277H04W88/02
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 10,515,142
App. No.
15/183,069
Granted
Dec 24, 2019
Kind
B2
Abstract

A method is provided for extracting page information. The method includes obtaining to-be-processed source code of a webpage; based on a preset filtering characteristic string and a preset tag matching mode, extracting target information from the source code; and generating page information in a specified format based on the extracted target information.

Claims (85)

1. A method for extracting page information, comprising:

obtaining, by a processor, to-be-processed source code of a webpage and dividing the source code of the webpage into one or more code segments;

while obtaining the source code of the webpage and dividing the source code of the webpage, simultaneously extracting without generating a DOM tree, by the processor, target information from each code segment of the one or more code segments of the source code;

simultaneously extracting the one or more code segments of the source code to generate the page information, wherein extracting the target information from each code segment includes:

performing a lexical analysis on each code segment and obtaining a plurality of pieces of tag information of each code segment;

from the plurality of pieces of tag information of each code segment, deleting tag information matching a preset filtering characteristic string from each code segment of the source code; and

according to a model, a screen size, a screen resolution, and a hardware processing capability of a mobile terminal, selecting and extracting, from undeleted tag information, tag information matching a preset tag matching mode as the target information of each code segment; and

generating, by the processor, the page information in a specified format based on the extracted target information of each code segment of the one or more code segments.

2. The method according to claim 1 , wherein deleting the tag information matching the preset filtering characteristic string further includes:

reading an opening tag string of the tag information;

determining whether the opening tag string contains the preset filtering characteristic string; and

when it is determined that the opening tag string contains the preset filtering characteristic string, determining that the tag information matches the preset filtering characteristic string and deleting the tag information,

wherein the deleted tag information is unsuitable for a screen of the mobile terminal and comprises video-type tag information, image-type tag information, sub-link type tag information, or a combination thereof.

3. The method according to claim 1 , wherein:

the preset tag matching mode is a single tag matching mode, and

selecting and extracting, from the undeleted tag information, the tag information matching the preset tag matching mode as the target information further includes:

sequentially tag matching all of the undeleted tag information with the single tag matching mode; and

extracting tag information matching the single tag matching mode as the target information.

4. The method according to claim 1 , wherein:

the preset tag matching mode is a composite tag matching mode, and

selecting and extracting, from the undeleted tag information, the tag information matching the preset tag matching mode as the target information further includes:

sequentially tag matching all of the undeleted tag information with the composite tag matching mode; and

extracting multiple pieces of tag information sequentially arranged and matching the composite tag matching mode as the target information.

5. The method according to claim 1 , wherein:

dividing the source code of the webpage into one or more code segments includes:

based on a segmentation characteristic string, dividing the source code of the webpage into a plurality of code segments to obtain each code segment to be processed.

6. The method according to claim 1 , wherein obtaining the to-be-processed source code of the webpage further includes:

receiving a request from a user for the webpage and sending the webpage request to a corresponding web server; and

receiving a source code of the webpage from the web server through streaming, the received source code being the to-be-processed source code of the webpage.

7. The method according to claim 1 , wherein generating the page information in the specified format based on the extracted target information of each code segment of the one or more code segments further includes:

based on the extracted target information of each code segment of the one or more code segments, generating corresponding page display code to be used by a browser to load and display the page information of the target information.

8. A mobile terminal, comprising:

a memory, and

a processor coupled to the memory and configured to:

obtain to-be-processed source code of a webpage and divide the source code of the webpage into one or more code segments;

while obtaining the source code of the webpage and dividing the source code of the webpage, simultaneously extract without generating a DOM tree, target information from each code segment of the one or more code segments of the source code;

simultaneously extracting the one or more code segments of the source code to generate the page information, wherein extracting the target information from each code segment includes:

performing a lexical analysis on each code segment and obtaining a plurality of pieces of tag information of each code segment;

from the plurality of pieces of tag information of each code segment, deleting tag information matching a preset filtering characteristic string from each code segment of the source code; and

according to a model, a screen size, a screen resolution, and a hardware processing capability of a mobile terminal, selecting and extracting, from undeleted tag information, tag information matching a preset tag matching mode as the target information of each code segment; and

generate the page information in a specified format based on the extracted target information of each code segment of the one or more code segments.

9. The mobile terminal according to claim 8 , wherein the processor is further configured to:

read an opening tag string of a tag information;

determine whether the opening tag string contains the preset filtering characteristic string; and

when it is determined that the opening tag string contains the preset filtering characteristic string, determine that the tag information matches the preset filtering characteristic string and to delete the tag information,

wherein the deleted tag information is unsuitable for a screen of the mobile terminal and comprises video-type tag information, image-type tag information, sub-link type tag information, or a combination thereof.

10. The mobile terminal according to claim 8 , wherein the preset tag matching mode is a single tag matching mode, and the processor is further configured to:

sequentially tag match all of the undeleted tag information with the single tag matching mode; and

extract tag information matching the single tag matching mode as the target information.

11. The mobile terminal according to claim 8 , wherein the preset tag matching mode is a composite tag matching mode, and the processor is further configured to:

sequentially tag match all of the undeleted tag information with the composite tag matching mode; and

extract multiple pieces of tag information sequentially arranged and matching the composite tag matching mode as the target information.

12. The mobile terminal according to claim 8 , wherein the processor is further configured to:

based on a segmentation characteristic string, divide the source code of the webpage into a plurality of code segments to obtain each code segment to be processed.

13. The mobile terminal according to claim 8 , wherein the processor is further configured to:

receive a request from a user for the webpage and send the webpage request to a corresponding web server; and

receive a source code of the webpage from the web server through streaming, the received source code being the to-be-processed source code of the webpage.

14. The mobile terminal according to claim 8 , wherein the processor is further configured to, based on the extracted target information of each code segment of the one or more code segments, generate corresponding page display code to be used by a browser to load and display the page information of the target information.

15. A non-transitory computer readable memory comprising a computer readable program stored thereon, wherein, when being executed, the computer readable program causes a computer to implement a method for extracting page information, the method comprising:

obtaining to-be-processed source code of a webpage and dividing the source code of the webpage into one or more code segments;

while obtaining the source code of the webpage and dividing the source code of the webpage, simultaneously extracting without generating a DOM tree, target information from each code segment of the one or more code segments of the source code;

simultaneously extracting the one or more code segments of the source code to generate the page information, wherein extracting the target information from each code segment includes:

performing a lexical analysis on each code segment and obtaining a plurality of pieces of tag information of each code segment;

from the plurality of pieces of tag information of each code segment, deleting tag information matching a preset filtering characteristic string from each code segment of the source code; and

according to a model, a screen size, a screen resolution, and a hardware processing capability of a mobile terminal, selecting and extracting, from undeleted tag information, tag information matching a preset tag matching mode as the target information of each code segment; and

generating the page information in a specified format based on the extracted target information of each code segment of the one or more code segments.

16. The non-transitory computer readable memory of claim 15 , wherein deleting the tag information matching the preset filtering characteristic string further includes:

reading an opening tag string of the tag information;

determining whether the opening tag string contains the preset filtering characteristic string; and

when it is determined that the opening tag string contains the preset filtering characteristic string, determining that the tag information matches the preset filtering characteristic string and deleting the tag information,

wherein the deleted tag information is unsuitable for a screen of the mobile terminal and comprises video-type tag information, image-type tag information, sub-link type tag information, or a combination thereof.

17. The non-transitory computer readable memory of claim 15 , wherein the preset tag matching mode is a single tag matching mode, and selecting and extracting, from the undeleted tag information, the tag information matching the preset tag matching mode as the target information further includes:

sequentially tag matching all of the undeleted tag information with the single tag matching mode; and

extracting the tag information matching the single tag matching mode as the target information.

18. The non-transitory computer readable memory of claim 15 , wherein the preset tag matching mode is a composite tag matching mode, and selecting and extracting, from the undeleted tag information, the tag information matching the preset tag matching mode as the target information further includes:

sequentially tag matching all of the undeleted tag information with the composite tag matching mode; and

extracting multiple pieces of tag information sequentially arranged and matching the composite tag matching mode as the target information.

19. The non-transitory computer readable memory of claim 15 , wherein:

dividing the source code of the webpage into one or more code segments includes:

based on a segmentation characteristic string, dividing the source code of the webpage into a plurality of code segments to obtain each code segment to be processed.

20. The non-transitory computer readable memory of claim 15 , wherein obtaining the to-be-processed source code of the webpage further includes:

receiving a request from a user for the webpage and sending the webpage request to a corresponding web server; and

receiving a source code of the webpage from the web server through streaming, the received source code being the to-be-processed source code of the webpage.

21. The non-transitory computer readable memory of claim 15 , wherein generating page information in a specified format based on the extracted target information of each code segment of the one or more code segments further includes:

based on the extracted target information of each code segment of the one or more code segments, generating corresponding page display code to be used by a browser to load and display the page information of the target information.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded May 28, 2020
From: GUANGZHOU UCWEB COMPUTER TECHNOLOGY CO., LTD
To: ALIBABA GROUP HOLDING LIMITED
Reel/Frame 052771/0562 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jun 15, 2016
From: CAI, MING
To: GUANGZHOU UCWEB COMPUTER TECHNOLOGY CO., LTD
Reel/Frame 038919/0897 →
Priority Claims (1)
CN 2015 1 0335008 · Jun 15, 2015 · national
Continuity (1)
Related Publication 20160364373A1 · Dec 15, 2016