IP Library › Granted Patent US 10,430,514
Granted Patent B2
US 10,430,514 · App. 15/175,093 · Granted Oct 1, 2019

Method and terminal for extracting webpage content, and non-transitory storage medium

Inventors: Xinhua Guo (Shenzhen, CN); Ke Su (Shenzhen, CN); Ning Ma (Shenzhen, CN); Jingyao Wang (Shenzhen, CN)
Assignee: TENCENT TECHNOLOGY (SHENZHEN) COMPANY LIMITED
G06F17/272G06F16/93G06F16/958
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,430,514
App. No.
15/175,093
Filed
Jun 7, 2016
Granted
Oct 1, 2019
Kind
B2
Art Unit
2158
USPC
707/755
Abstract

A method, a terminal and a non-transitory storage medium for extracting webpage content includes: responding to a webpage browsing instruction triggered on a browser by a mobile client to obtain a corresponding webpage; parsing the webpage to obtain a DOM node of a tag in a webpage script; obtaining a plug-in tag node from the DOM node; and when a plug-in tag corresponding to the plug-in tag node is a predetermined type tag, extracting a plug-in resource that corresponds to the plug-in tag. The present method can complete extracting of content that complies with a specific protocol specification when a webpage has not been truly rendered, thereby improving a speed of extracting predetermined webpage content and also improving a webpage display speed.

Claims (47)

1. A method for extracting webpage content performed at a terminal having one or more processors and a memory for storing programs to be executed by the processors, the method comprising:

responding to a webpage browsing instruction triggered on a browser by a mobile client to obtain a corresponding webpage;

detecting whether an existing predetermined rule within a script code on the terminal for extracting a plug-in resource that corresponds to a predetermined type tag is updated to facilitate dynamic configuration of the existing predetermined rule by a background server;

at a time when the existing predetermined rule for extracting a plug-in resource that corresponds to a predetermined type tag is updated, obtaining an updated predetermined rule from the background server of the browser, the updated predetermined rule including a regular expression rule;

after obtaining the updated predetermined rule, parsing the webpage to obtain a document object model (DOM) node of a tag in a webpage script;

obtaining a plug-in tag node from the DOM node;

when a plug-in tag corresponding to the plug-in tag node is a predetermined type tag, extracting a plug-in resource that corresponds to the plug-in tag;

when the plug-in tag corresponding to the plug-in tag node is not the predetermined type tag, matching a plug-in resource that corresponds to the predetermined type tag of the webpage script by using the updated predetermined rule; and

after the matching succeeds, extracting the plug-in resource that corresponds to the predetermined type tag from the webpage script.

2. The method according to claim 1 , wherein the browser supports a plug-in resource protocol that adapts to the updated predetermined rule.

3. The method according to claim 1 , wherein the parsing the webpage to obtain a DOM node of a tag in a webpage script comprises:

parsing the webpage to generate a DOM tree; and

creating a DOM node, in the DOM tree, for each tag in the webpage script.

4. The method according to claim 1 , further comprising:

transmitting the plug-in resource to a corresponding player for playing.

5. A terminal for extracting webpage content, comprising:

one or more processors;

a memory, wherein the memory stores instructions that when executed by the one or more processors cause the one or more processors to:

respond to a webpage browsing instruction triggered on a browser by a mobile client to obtain a corresponding webpage;

detect whether an existing predetermined rule within a script code on the terminal for extracting a plug-in resource that corresponds to a predetermined type tag is updated to facilitate dynamic configuration of the existing predetermined rule by a background server;

at a time when the existing predetermined rule for extracting a plug-in resource that corresponds to a predetermined type tag is updated, obtain an updated predetermined rule from the background server of the browser, the updated predetermined rule including a regular expression rule;

after obtaining the updated predetermined rule, parse the webpage to obtain a DOM node of a tag in a webpage script;

obtain a plug-in tag node from the DOM node;

when a plug-in tag corresponding to the plug-in tag node is a predetermined type tag, extract a plug-in resource that corresponds to the plug-in tag;

when the plug-in tag corresponding to the plug-in tag node is not the predetermined type tag, match a plug-in resource that corresponds to the predetermined type tag of the webpage script by using the updated predetermined rule; and

after the matching succeeds, extract the plug-in resource that corresponds to the predetermined type tag from the webpage script.

6. The terminal according to claim 5 , wherein the browser supports a plug-in resource protocol that adapts to the updated predetermined rule.

7. The terminal according to claim 5 , wherein the instructions are further configured to cause the one or more processors to:

parse the webpage to generate a DOM tree; and create a DOM node, in the DOM tree, for each tag in the webpage script.

8. The terminal according to claim 5 , wherein the instructions are further configured to cause the one or more processors to:

transmit the plug-in resource to a corresponding player for playing.

9. Non-transitory storage media, comprising computer program codes for executing a process of:

at a terminal:

responding to a webpage browsing instruction triggered on a browser by a mobile client to obtain a corresponding webpage;

detecting whether an existing predetermined rule within a script code on the terminal for extracting a plug-in resource that corresponds to a predetermined type tag is updated to facilitate dynamic configuration of the existing predetermined rule by a background server;

at a time when the existing predetermined rule for extracting a plug-in resource that corresponds to a predetermined type tag is updated, obtaining an updated predetermined rule from the background server of the browser, the updated predetermined rule including a regular expression rule;

after obtaining the updated predetermined rule, parsing the webpage to obtain a document object model (DOM) node of a tag in a webpage script;

obtaining a plug-in tag node from the DOM node;

when a plug-in tag corresponding to the plug-in tag node is a predetermined type tag, extracting a plug-in resource that corresponds to the plug-in tag;

when the plug-in tag corresponding to the plug-in tag node is not the predetermined type tag, matching a plug-in resource that corresponds to the predetermined type tag of the webpage script by using the updated predetermined rule; and

after the matching succeeds, extracting the plug-in resource that corresponds to the predetermined type tag from the webpage script.

10. The non-transitory storage media according to claim 9 , wherein the browser supports a plug-in resource protocol that adapts to the updated predetermined rule.

11. The non-transitory storage media according to claim 9 , wherein the parsing the webpage to obtain a DOM node of a tag in a webpage script comprises:

parsing the webpage to generate a DOM tree; and

creating a DOM node, in the DOM tree, for each tag in the webpage script.

12. The non-transitory storage media according to claim 9 , wherein the process further comprises:

transmitting the plug-in resource to a corresponding player for playing.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jul 20, 2016
From: GUO, XINHUA; SU, KE; MA, NING; WANG, JINGYAO
To: TENCENT TECHNOLOGY (SHENZHEN) COMPANY LIMITED
Reel/Frame 039196/0665 →
Priority Claims (1)
CN 2014 1 0067190 · Feb 26, 2014 · national
Continuity (2)
Continuation PCTCN2015073167 · Feb 16, 2015
Related Publication 20160283461A1 · Sep 29, 2016
Cited By (2)
US 12,210,819 US 12,242,956