WO2018086476A1 - 网页处理方法、装置和存储介质 - Google Patents

网页处理方法、装置和存储介质 Download PDF

Info

Publication number
WO2018086476A1
WO2018086476A1 PCT/CN2017/109037 CN2017109037W WO2018086476A1 WO 2018086476 A1 WO2018086476 A1 WO 2018086476A1 CN 2017109037 W CN2017109037 W CN 2017109037W WO 2018086476 A1 WO2018086476 A1 WO 2018086476A1
Authority
WO
WIPO (PCT)
Prior art keywords
webpage
accessed
unconventional
domain name
elements
Prior art date
Application number
PCT/CN2017/109037
Other languages
English (en)
French (fr)
Inventor
王健
杜国阳
程虎
Original Assignee
腾讯科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 腾讯科技(深圳)有限公司 filed Critical 腾讯科技(深圳)有限公司
Publication of WO2018086476A1 publication Critical patent/WO2018086476A1/zh
Priority to US16/299,883 priority Critical patent/US10726135B2/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/55Detecting local intrusion or implementing counter-measures
    • G06F21/56Computer malware detection or handling, e.g. anti-virus arrangements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/57Certifying or maintaining trusted computer platforms, e.g. secure boots or power-downs, version controls, system software checks, secure updates or assessing vulnerabilities
    • G06F21/577Assessing vulnerabilities and evaluating computer system security
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design
    • G06F8/22Procedural
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9535Search customisation based on user profiles and personalisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9577Optimising the visualization of content, e.g. distillation of HTML documents
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • G06F21/12Protecting executable software
    • G06F21/121Restricting unauthorised execution of programs
    • G06F21/125Restricting unauthorised execution of programs by manipulating the program code, e.g. source code, compiled code, interpreted code, machine code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/542Event management; Broadcasting; Multicasting; Notifications
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/03Indexing scheme relating to G06F21/50, monitoring users, programs or devices to maintain the integrity of platforms
    • G06F2221/032Protect output to user by software means
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/03Indexing scheme relating to G06F21/50, monitoring users, programs or devices to maintain the integrity of platforms
    • G06F2221/034Test or assess a computer or a system

Definitions

  • the present application relates to the field of Internet technologies, and in particular, to a webpage processing method, apparatus, and storage medium.
  • unconventional elements in a webpage are usually filtered before the webpage is rendered.
  • the non-conventional elements are filtered before the web page is rendered, the user cannot perceive it, and if the filtering effect is not good, there will still be a large number of unconventional elements in the rendered web page. Therefore, in the conventional technology, the unconventional elements displayed in the webpage cannot be filtered. If the normal content and the non-conventional elements in the webpage are randomly changed, the conventional webpage processing method will result in inaccurate filtering, which leads to filtering of irregular elements. The effect is not good.
  • a webpage processing method comprising:
  • a web page processing apparatus comprising a processor and a memory, wherein the memory stores instructions executable by the processor, and when the instructions are executed, the processor is configured to:
  • a non-volatile computer storage medium having stored therein a computer program for performing the above method.
  • 1 is an application environment diagram of a webpage processing method in an embodiment
  • FIG. 2 is a schematic structural diagram of a terminal in an embodiment
  • FIG. 3 is a schematic flowchart of a webpage processing method in an embodiment
  • FIG. 4 is a schematic flow chart of detecting whether an unconventional element exists in a webpage element in one embodiment
  • FIG. 5 is a schematic flowchart of a webpage processing method in another embodiment
  • FIG. 6 is a schematic diagram of an interface after rendering a webpage in an embodiment
  • Figure 7 is an effect diagram of filtering unconventional elements in one embodiment
  • FIG. 8 is a structural block diagram of a webpage processing apparatus in an embodiment
  • Figure 9 is a block diagram showing the structure of an unconventional element detecting module in one embodiment.
  • terminal 110 communicates with server 120 over a network.
  • the terminal 110 displays a webpage, it needs to perform webpage loading, webpage parsing, and webpage rendering process. Often, some unconventional elements can be intercepted before the page is rendered.
  • the terminal 110 may further detect whether there is an unconventional element in the obtained webpage element after performing the rendering of the webpage. If yes, generate an interactive portal in the webpage.
  • the terminal 110 Unconventional elements exist for filtering.
  • the terminal 110 can be, but is not limited to, a variety of personal computers, notebook computers, desktop computers, smart phones, tablets, portable wearable devices, and the like that can request and display web pages. Since the terminal 110 can also filter the non-conventional elements existing in the webpage after displaying the webpage, the unconventional elements in the webpage are filtered more accurately.
  • FIG. 2 is a schematic diagram showing the internal structure of a terminal in an embodiment.
  • the terminal includes a processor connected through a system bus, a non-volatile storage medium, a network interface, an internal memory, and an input device.
  • the non-volatile storage medium of the terminal may be a memory in which an operating system is stored, and further includes a webpage processing apparatus, and the webpage processing apparatus is configured to implement a webpage processing method.
  • a non-volatile storage medium of the terminal stores a computer program for executing the web page processing method described in the following embodiments.
  • the processor is used to provide computing and control capabilities to support the operation of the entire terminal.
  • the internal memory in the terminal provides an environment for the operation of the web processing device in the non-volatile storage medium, and the network interface is used to communicate with the server, such as sending a URL request to the server, receiving resources sent by the server, and the like.
  • the input device may be a touch layer covered on the display screen, or may be a keyboard mouse or a trackball or a touchpad provided on the terminal housing.
  • FIG. 2 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the terminal to which the solution of the present application is applied, and the specific terminal may be To include more or fewer components than shown in the figures, or to combine certain components, or to have different component arrangements.
  • a webpage processing method is provided, which is applied to the terminal shown in FIG. 1 and FIG. 2, and includes:
  • Step 302 Obtain a webpage element after the webpage is to be accessed by the webpage to be accessed.
  • the terminal initiates an access request, for example, after the URL request, performing a webpage loading, a webpage parsing, and a webpage rendering process. Specifically, the terminal performs domain name resolution according to the requested URL, initiates a request to the server, and receives resources (such as HTML, JS, CSS, and images, etc.) sent by the server. Parse the loaded resources (such as HTML, JS, CSS, images, etc.) and build corresponding internal data structures (such as HTML DOM tree, JS object property table, CSS style rules, etc.). Before rendering the to-be-visited webpage, the terminal may filter the non-conventional elements existing in the visited webpage.
  • resources such as HTML, JS, CSS, and images, etc.
  • the terminal performs rendering processing on the to-be-visited webpage.
  • the terminal may construct a rendering tree, perform position calculation, style calculation, and the like on each element of the to-be-accessed webpage, and render the page according to the rendering tree to obtain a webpage element after the webpage is rendered.
  • the webpage elements after the webpage is rendered include the webpage content that should be displayed normally.
  • the terminal treats the non-conventional elements that exist in the visited webpage before rendering, some unconventional elements may still be included in the rendered webpage to be accessed.
  • Step 304 Detect whether there are non-conventional elements in the webpage element.
  • the terminal may detect whether an unconventional element exists in the webpage element according to the domain name to which the webpage to be accessed belongs and the key attribute of the preset webpage element.
  • the correspondence between the domain name and the key attribute of the webpage element may be preset, and the key attribute of the webpage element corresponding to the set domain name may be a key attribute possessed by the unconventional element.
  • the domain name and the corresponding web page element key attributes may be pre-stored in the server, or in the terminal local, or pre-stored in the server and the terminal local.
  • the terminal may detect, according to the locally stored domain name and the corresponding key attribute of the webpage element, whether there is an unconventional element in the webpage element after the webpage is rendered.
  • the terminal may further perform in the server. Match to improve the accuracy of the match.
  • both the terminal and the server store the corresponding attributes of the domain name and the key attributes of the web page element.
  • the attributes 4 and 5 have not been updated synchronously to the corresponding relationship stored in the terminal.
  • the terminal When the user opens the website www.123.com , the terminal will find the corresponding preset rule according to the domain name www.123.com , attr1, attr 2, attr 3, and find the current in the rendered webpage opened in the browser. Whether there is at least one element in the webpage whose element attribute matches any of attr 1, attr 2, and attr3. If it is determined that at least one element that meets the above conditions exists in the current webpage, determining that there is an unconventional element in the rendered webpage; if there is no element in the current webpage that meets the above condition, the terminal sends a request to the server to request Find the key attributes of the remaining corresponding web page elements according to the domain name www.123.com .
  • the server returns the characteristics of the cloud to the terminal, attr1
  • the terminal continues to determine, according to the received cloud feature, whether at least one element exists in the opened rendered webpage, and the element attribute matches the key attribute of at least one webpage element in attr1
  • Step 306 if there are non-conventional elements in the webpage element, an interactive portal is generated and displayed in the webpage.
  • the portal is interactively invoked and, when a user operation is received, the interaction entry is invoked to effect a page function interaction in response to a user operation.
  • the interaction portal may be a floating window or a control displayed on the webpage or the terminal display interface.
  • the interactive portal can be used as a one-click filtering portal, for example, a one-click filtering button.
  • the terminal filters the unconventional elements displayed in the webpage in response to the user's click operation; when the user right-clicks the one-click filter button, the interactive portal and the terminal product can be logged. View, product and function settings, exit and other operations.
  • the user can set an interface of the interaction portal, so that the interaction portal can perform partial filtering, such as packet filtering, on the unconventional elements existing in the rendered webpage.
  • the user can also drag the interface of the interactive portal to move and change the location of the interactive portal.
  • Step 308 Acquire a trigger operation on the interaction entry, and filter the non-conventional element in response to the trigger operation.
  • the interactive portal when the user needs to filter the unconventional elements displayed in the rendered webpage, the interactive portal may be triggered, for example, by clicking a one-click filtering button, and the terminal responds to the triggering operation of the one-key filtering button to invoke the interactive portal. This will filter the unconventional elements displayed in the rendered web page.
  • the user can perform group filtering operations on these unconventional elements according to the specific content of the unconventional elements displayed in the rendered web page. For example, filter one or more sets of unconventional elements as needed. And, the user can further set the function of the interactive portal to recover the unconventional elements that have been filtered.
  • Unconventional elements are filtered. Since the unconventional elements existing in the webpage can be filtered after the webpage is rendered, and the filtering is performed after the user operation is obtained, the filtering operation of the unconventional elements displayed on the webpage can be realized even if the normal content in the webpage is normal. And unconventional elements are often randomly changed. As long as the non-conventional elements are present in the webpage after the webpage is rendered, the non-conventional elements can be filtered out by the user operation, so that the filtering of the unconventional elements in the webpage is more accurate.
  • detecting whether there is an unconventional element in the webpage element includes: searching whether the domain name to which the webpage to be accessed belongs has a corresponding preset webpage element key attribute, and if yes, detecting whether the key attribute of the found webpage element has At least one item exists in the webpage to be accessed; if at least one of the key attributes of the found webpage element exists in the webpage to be accessed, the non-conventional element exists in the webpage element, otherwise the non-conventional element does not exist in the webpage element.
  • whether the domain name of the webpage to be accessed belongs to the corresponding preset webpage element key attribute includes: determining whether the domain name of the webpage of the webpage to be accessed has a corresponding preset The key attribute of the webpage element, if yes, enters a step of detecting whether the key attribute of the searched webpage element has at least one existing in the to-be-visited webpage; otherwise, further searching whether the top-level domain name of the webpage of the to-be-accessed webpage has a corresponding preset The key attribute of the webpage element, if yes, enters a step of detecting whether the key attribute of the found webpage element has at least one step existing in the webpage to be accessed, otherwise there is no non-conventional element in the webpage element.
  • the step of detecting whether an unconventional element exists in a webpage element includes:
  • Step 402 Find whether the domain name of the webpage of the webpage to be accessed has a corresponding preset webpage element key attribute, and if yes, proceed to step 406, otherwise proceed to step 404.
  • the key attributes of the webpage element are set in advance, and the key attribute of the set webpage element is an attribute feature of the unconventional element.
  • the key attributes of the set webpage element include a Class attribute and an id attribute.
  • a style attribute or other attribute may also be included.
  • the correspondence between the domain name and the key attribute of the webpage element is also set in advance, and the correspondence indicates that the non-conventional element exists in the web address under the domain name. Further, the correspondence may be stored in the server (the cloud), or locally at the terminal, or stored locally at the server and the terminal. It can be updated to the terminal synchronously when the server has an update.
  • the terminal may first search for the domain name of the webpage of the webpage to be accessed according to the corresponding relationship between the domain name and the key attribute of the webpage element, and if the domain name of the webpage to be accessed exists, the terminal may enter the step 404. Then, the search may be further performed on the server. If it is found in the server, the process proceeds to step 404. If it is not found in the server, the process proceeds to step 406.
  • Step 404 Find whether the top-level domain name of the webpage of the webpage to be accessed has a corresponding preset webpage element key attribute, and if yes, proceed to step 406, otherwise proceed to step 408.
  • the top-level domain name of the webpage of the webpage to be accessed may be further searched for whether the corresponding preset webpage element key attribute exists.
  • the correspondence between the domain name and the key attributes of the webpage element is set in advance. If the top-level domain name of the webpage of the webpage to be accessed has a corresponding key attribute of the preset webpage element, it indicates that the webpage to be accessed may also have an unconventional element.
  • the terminal may also first find the URL of the webpage to be accessed locally. Whether the top-level domain has a corresponding preset key element of the webpage element. If it is found, the process proceeds to step 406. If it is not found, the search may be further performed on the server. If it is found in the server, the process proceeds to step 406. Otherwise, the process proceeds to step 408. .
  • Step 406 Detect whether at least one of the key attributes of the found webpage element exists in the to-be-accessed webpage, and if yes, proceed to step 410; otherwise, proceed to step 408.
  • Step 408 the non-conventional element does not exist in the webpage element obtained after the webpage is rendered.
  • Step 410 An unconventional element exists in a webpage element obtained after the webpage is rendered.
  • the domain name or the top-level domain name of the webpage of the webpage to be accessed has a corresponding key attribute of the preset webpage element
  • Unconventional elements in the web page the non-conventional elements of the web page to be accessed. If at least one key attribute is not matched, there are no non-conventional elements on the page to be accessed.
  • the preset key attributes of the webpage element include a Class attribute, an id attribute, a style attribute, and other attributes, and when the webpage elements in the webpage to be accessed are matched, the attributes may be matched one by one.
  • the key attribute of the webpage element of the non-conventional element is matched, and then the key attribute of the matched webpage element is detected to exist in the to-be-visited webpage, if present , indicating that there are unconventional elements in the web page to be accessed, otherwise there are no unconventional elements. Since the key attributes of the webpage elements stored in the server or locally stored by the terminal may be expired, the matching process can ensure that the key attributes matched in the to-be-visited webpage are the key attributes determined by the preset unconventional elements. It is therefore possible to ensure the accuracy of detecting unconventional elements in the web page to be accessed.
  • the interaction entry is generated and displayed in the webpage, including: if there is an unconventional element in the webpage element, the webpage to be accessed
  • the preset JS code is injected into the already rendered page, and the interactive entry is generated and displayed in the webpage through the JS code, and the JS code is also used to filter all the non-conventional elements in response to the triggering operation of the interactive portal, or to filter the packets.
  • the non-conventional element is filtered in response to the triggering operation, including: obtaining location size information of the non-conventional element in the webpage, and obtaining location size information of the interactive portal in the webpage; The location size information and the location size information of the interactive portal in the webpage move the non-conventional elements to the position corresponding to the interactive portal according to the preset animation effect until disappearing.
  • a webpage processing method is provided, which is applied to the terminal in FIG. 1 or FIG. 2, and includes:
  • Step 502 Obtain a webpage element after the webpage is to be accessed by the webpage to be accessed.
  • the webpage loading, the webpage parsing, and the webpage rendering process are performed.
  • the entire page is loaded, and the user can see the complete webpage page.
  • some unconventional elements existing in the webpage can be intercepted, and some non-conventional elements are intercepted, and then the webpage is rendered.
  • the entire web page can be displayed.
  • the web page elements are displayed in the web page. These web page elements may contain some unconventional elements in addition to the web content displayed normally.
  • Step 504 Detect whether there is an unconventional element in the webpage element, and if yes, proceed to step 506, otherwise end.
  • the domain name of the webpage to be accessed is matched with the domain name stored locally by the terminal, and after matching the domain name, the preset key attribute of the webpage element corresponding to the domain name is obtained. If the match is not reached, the server is matched to the domain name, so as to obtain the preset key attribute of the webpage element corresponding to the domain name to which the webpage to be accessed belongs.
  • the domain name to which the to-be-visited webpage belongs includes the domain name and the top-level domain name of the webpage of the webpage to be accessed. In the case of matching, the domain name of the webpage of the visited webpage is first matched, and when the matching is not reached, the top-level domain name of the webpage of the visited webpage is further matched.
  • the non-conventional element exists on the webpage to be accessed, otherwise it is to be accessed. There are no unconventional elements on the page.
  • Step 506 Inject a preset JS code into the page of the webpage to be accessed, and generate an interaction portal in the webpage through the JS code and display.
  • a browser plug-in can be injected into the web browser, and the browser plug-in can be used to detect whether there is an unconventional element in the webpage element obtained after the rendering of the webpage, and if yes, inject the preset into the page.
  • JS code which implements a functional interaction implementation that generates an interaction entry in a web page and implements the interaction entry.
  • the interaction entry may be an entry for filtering unconventional elements in the webpage, for example, a control displayed on the page, such as a one-click filter button.
  • a control displayed on the page such as a one-click filter button.
  • FIG. 6 after the webpage is rendered, the entire webpage page is displayed.
  • the non-conventional elements 602 may be advertisement content, fake content, or other content unrelated to the webpage theme.
  • a one-click filter button 604 is generated in the page, which may be an icon as shown in FIG.
  • Step 508 Acquire a trigger operation on the interaction portal, and move the non-conventional element in the webpage to a position corresponding to the interaction entry in response to the trigger operation until disappearing.
  • the functional interaction of the interaction portal can be implemented by the preset JS code injected into the page.
  • the user triggers the interaction entry, for example, clicking the one-click filter button 604, responding to the operation by using a preset JS code, thereby obtaining location size information of the non-conventional element in the webpage, and obtaining the interaction entry in the webpage.
  • the location size information is based on the location size information of the non-conventional elements in the webpage and the location size information of the interactive portal in the webpage, and moves the non-conventional elements to the corresponding position of the interactive portal according to the preset animation effect until disappearing.
  • the non-conventional elements when it is detected that there are non-conventional elements in the webpage to be accessed, the non-conventional elements may be obtained according to the key attributes of the matched webpage elements, and the location size information of the non-conventional elements is obtained.
  • the location size information of the interactive portal can be obtained according to a preset JS code.
  • the distance between each non-conventional element and the interaction entry may be obtained according to the location size information of the non-conventional element and the location size information of the interaction entry, and each non-conventional element is moved to the location of the interaction entry according to the distance. And then hide and disappear.
  • the size of the non-conventional element may be gradually reduced until it disappears at the interactive entry position, so that the animation of the unconventional element dynamically moves and gradually decreases until disappears.
  • each non-conventional element A is translated to the position of the interactive entry B and disappears.
  • the filtering of unconventional elements can be achieved by a certain animation effect.
  • the unconventional elements are translated to the interactive entry position and gradually reduced until they disappear at the interactive entry position.
  • the interactive entry A recycling animation can be rendered to achieve a display that recycles unconventional elements.
  • an interactive entry is displayed when an unconventional element exists in a webpage element obtained after detecting that the webpage is rendered. Since the entire page is loaded after the web page is rendered, the user can also see the non-conventional elements in the web page, so you can choose whether to filter the unconventional elements in the page.
  • the unconventional elements displayed in the webpage can be triggered by the one-click interaction of the interactive portal. And through a certain animation effect, the non-conventional elements can be translated to the interactive entry position until disappearing, and the effect of recycling the unconventional elements displayed in the webpage is realized.
  • a webpage processing apparatus comprising:
  • the webpage element obtaining module 802 is configured to obtain a webpage element after the webpage is to be accessed by the webpage to be accessed.
  • the non-conventional element detection module 804 is configured to detect whether an unconventional element exists in a webpage element.
  • the icon generating module 806 is configured to generate an interactive portal in the webpage and display if an unconventional element exists in the webpage element.
  • the filtering module 808 is configured to obtain a triggering operation on the interaction portal, and filter the non-conventional elements in response to the triggering operation.
  • the non-conventional element detection module 804 includes:
  • the searching module 814 is configured to find whether a domain name to which the web page to be accessed belongs belongs to a corresponding preset webpage element key attribute.
  • the detecting module 824 is configured to detect, if the domain name to which the webpage to be accessed belongs, a key attribute of the preset webpage element, whether at least one of the key attributes of the found webpage element exists in the to-be-visited webpage; if the found webpage element If at least one of the key attributes exists in the web page to be accessed, there are non-conventional elements in the webpage element. Otherwise, there are no unconventional elements in the webpage element.
  • the searching module 814 is configured to search for a domain name of a webpage of the webpage to be accessed, and the detecting module 824 is further configured to: if the searching module 814 detects the webpage of the webpage to be accessed. If the domain name has a corresponding key attribute of the webpage element, it is detected whether at least one of the key attributes of the webpage element exists on the webpage to be accessed. In this embodiment, the search module 814 is further configured to: if the domain name of the webpage of the webpage to be accessed is not found, the top-level domain name of the webpage of the to-be-accessed webpage is further searched for the corresponding preset webpage. The key attributes of the element.
  • the detecting module 824 is further configured to: if the top-level domain name of the webpage of the webpage to be accessed is found to have a corresponding preset webpage element key attribute, detecting whether at least one of the key attributes of the found webpage element exists in the Access the page, otherwise there are no unconventional elements in the page element.
  • the icon generating module 806 is configured to: if a non-conventional element exists in the webpage element, inject a preset JS code into the page of the webpage to be accessed, generate an interaction entry in the webpage through the JS code, and display the
  • the JS code is also used to filter non-conventional elements in response to triggering of the interactive entry.
  • the filtering module 808 is configured to obtain location size information of the non-conventional element in the webpage, and obtain location size information of the interaction entry in the webpage, according to the location size information and the interaction entry of the non-conventional element in the webpage.
  • the position size information in the webpage moves the non-conventional elements to the position corresponding to the interactive entry according to the preset animation effect until disappearing.
  • the storage medium may be a magnetic disk, an optical disk, or a read-only memory (ROM). Wait.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Multimedia (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Virology (AREA)
  • Computing Systems (AREA)
  • Technology Law (AREA)
  • Information Transfer Between Computers (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

一种网页处理方法,所述方法包括:获取待访问网页进行网页渲染后的网页元素(302);检测所述网页元素中是否存在非常规元素(304);如果所述网页元素中存在非常规元素,则在网页中生成交互入口并显示(306);获取对所述交互入口的触发操作,响应所述触发操作将所述非常规元素进行过滤。

Description

网页处理方法、装置和存储介质
本申请要求于2016年11月10日提交中国专利局、申请号为201610989440.3、发明名称为“网页处理方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及互联网技术领域,特别是涉及一种网页处理方法、装置和存储介质。
发明背景
使用浏览器打开网页时,很多网页往往会显示很多非常规的网页元素,例如,广告、欺诈、虚假、低俗内容等与网页主题无关且具有一定骚扰性的网页元素,这些网页元素在网页中的存在给用户浏览网页带来很大不便。例如,在下载网站下载软件时往往会被误导去下载一个恶意的软件。又如,通过网站提供的链接跳转到某个网站时,往往会被诱导到一个不相关的网站或者欺诈网站。
传统技术中,通常在网页渲染前会对网页中的非常规元素进行过滤。然而,由于是在网页渲染前对非常规元素进行过滤,用户无法感知,且如果过滤的效果不佳时,渲染后的网页中仍然会存在大量的非常规元素。因此,传统技术中,网页中显示的非常规元素无法进行过滤,如果网页中的正常内容和非常规元素随机变化时,传统的这种网页处理方式将导致过滤不精确,从而导致过滤非常规元素的效果不佳。
发明内容
基于此,有必要针对上述技术问题,提供一种能使得网页中非常规元素过滤得更精确的网页处理方法和装置。
一种网页处理方法,所述方法包括:
获取待访问网页进行网页渲染后的网页元素;
检测所述网页元素中是否存在非常规元素;
如果所述网页元素中存在非常规元素,则在网页中生成交互入口并显示;
获取对所述交互入口的触发操作,响应所述触发操作将所述非常规元素进行过滤。
一种网页处理装置,所述装置包括处理器和存储器,所述存储器中存储可被所述处理器执行的指令,当执行所述指令时,所述处理器用于:
获取待访问网页进行网页渲染后的网页元素;
检测所述网页元素中是否存在非常规元素;
如果所述网页元素中存在非常规元素,则在网页中生成交互入口并显示;
获取对所述交互入口的触发操作,响应所述触发操作将所述非常规元素进行过滤。
一种非易失性计算机存储介质,其中存储有计算机程序,该计算机程序用于执行上述方法。
附图简要说明
图1为一个实施例中网页处理方法的应用环境图;
图2为一个实施例中终端的结构示意图;
图3为一个实施例中网页处理方法的流程示意图;
图4为一个实施例中检测网页元素中是否存在非常规元素的流程示意图;
图5为另一个实施例中网页处理方法的流程示意图;
图6为一个实施例中网页渲染后的界面示意图;
图7为一个实施例中过滤非常规元素的效果图;
图8为一个实施例中网页处理装置的结构框图;
图9为一个实施例中非常规元素检测模块的结构框图。
实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
本申请实施例提供的网页处理方法可应用于如图1所示的环境中。请参考图1所示,终端110通过网络与服务器120进行通信。终端110显示一个网页时需要进行网页加载、网页解析和网页渲染过程。通常,在网页渲染之前,可对一些非常规元素进行拦截。终端110在进行网页渲染之后可再进一步检测得到的网页元素中是否存在非常规元素,如果存在,则在网页中生成一个交互入口,当终端110接收到该交互入口的触发操作时,对网页中存在的非常规元素进行过滤。其中,终端110可以是但不限于是各种可请求并显示网页的个人计算机、笔记本电脑、台式电脑、智能手机、平板电脑、便携式可穿戴设备等。由于终端110在显示网页后还可对网页中存在的非常规元素进行过滤,使得网页中的非常规元素过滤更为精确。
图2为一个实施例中终端的内部结构示意图。该终端包括通过系统总线连接的处理器、非易失性存储介质、网络接口、内存储器、输入装置。其中该终端的非易失性存储介质可以为存储器,其中存储有操作系统,还包括一种网页处理装置,该网页处理装置用于实现一种网页处理方法。在另外一个例子中,该终端的非易失性存储介质中存储有计算机程序,该计算机程序用于执行下面实施例中描述的网页处理方法。该处理器用于提供计算和控制能力,支撑整个终端的运行。终端中的内存储器为非易失性存储介质中的网页处理装置的运行提供环境,网络接口用于与服务器进行通信,如发送URL请求至服务器,接收服务器发送的资源等。输入装置可以是显示屏上覆盖的触摸层,也可以是键盘鼠标或者是终端外壳上设置的轨迹球或触控板等。
本领域技术人员可以理解,图2中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用与其上的终端的限定,具体的终端可 以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
如图3所示,在一个实施例中,提供了一种网页处理方法,该方法以应用于如图1和图2所示的终端中进行举例说明,包括:
步骤302,获取待访问网页进行网页渲染后的网页元素。
本实施例中,终端发起访问请求,比如,URL请求后,进行网页加载、网页解析和网页渲染过程。具体的,终端根据请求的URL进行域名解析,向服务器发起请求,接收服务器发送的资源(比如HTML、JS、CSS和图像等)。对加载到的资源(比如,HTML、JS、CSS和图像等)进行语法解析,建立相应的内部数据结构(比如HTML的DOM树、JS的对象属性表和CSS的样式规则等)。在对该待访问网页进行渲染之前,终端可以对待访问网页中存在的非常规元素进行过滤。
然后终端对该待访问网页进行渲染处理。具体的,终端可以构造渲染树,对该待访问网页中各个元素进行位置计算、样式计算等,根据渲染树对页面进行渲染,获取网页渲染后的网页元素。网页渲染后的网页元素包括应正常显示的网页内容。尽管在渲染之前,终端对待访问网页中存在的非常规元素进行了过滤,但是渲染后的待访问网页中仍然可能包括一些非常规元素。
步骤304,检测网页元素中是否存在非常规元素。
本实施例中,终端可根据待访问网页所属的域名以及预设的网页元素关键属性来检测网页元素中是否存在非常规元素。具体的,可预设域名和网页元素关键属性的对应关系,设置的域名对应的网页元素关键属性可为非常规元素所具有的关键属性。其中,域名和对应的网页元素关键属性可预先存储在服务器中,或者终端本地中,或同时预先存储在服务器和终端本地中。终端可预先根据本地存储的域名和对应的网页元素关键属性来检测网页渲染后的网页元素中是否存在非常规元素,当匹配不到与域名对应的网页元素关键属性时,可进一步在服务器中进行匹配,以提高匹配的准确性。
举例来说,假设终端和服务器中都存储了域名和网页元素关键属性的对应关 系,终端本地存储如下预设规则:域名rule_domain=www.123.com,其对应的网页元素关键属性rule_attr=attr1|attr2|attr3,即包括属性1,或属性2,或属性3。服务器中存储如下预设规则:域名rule_domain=www.123.com,其对应的网页元素关键属性rule_attr_cloud=attr1|attr2|attr3|attr4|attr5,即包括属性1,或属性2,或属性3,或属性4,或属性5。其中,属性4和5还未同步更新至所述终端存储的对应关系中。
当用户打开网站www.123.com时,终端会根据域名www.123.com找到对应的预设规则,attr1,attr 2,attr 3,并在浏览器中打开的已渲染的网页中,查找当前的网页内是否存在至少一个元素,其元素属性与attr 1,attr 2,attr3中的任何一个相匹配。若判断当前网页中存在符合上述条件的至少一个元素,则确定该渲染后的网页中存在非常规元素;若当前网页中不存在符合上述条件的元素,则所述终端发送请求至服务器,以请求根据域名www.123.com查找其余对应的网页元素关键属性。服务器向终端返回云端的特征,attr1|attr2|attr3|attr4|attr5。终端根据接收的云端特征,继续判断该打开的渲染后的网页中,是否存在至少一个元素,其元素属性与attr1|attr2|attr3|attr4|attr5中的至少一个网页元素关键属性相匹配,若找到符合上述条件的至少一个元素,则确定该渲染后的网页中存在非常规元素;否则,确定该渲染后的网页中不存在非常规元素。
步骤306,如果网页元素中存在非常规元素,则在网页中生成交互入口并显示。
本实施例中,如果检测到网页渲染后的网页元素中存在非常规元素,例如,广告、欺诈、虚假、低俗内容等与网页主题无关且有一定骚扰性的网页元素,则在网页中生成一个交互入口,并在接收到用户操作时,调用该交互入口,以便响应用户操作实现页面功能交互。进一步的,交互入口可以为一个展现于所述网页或终端显示界面上的浮窗或控件。该交互入口可以作为一键过滤入口,例如可以是一个一键过滤按键。比如,当用户左键点击该一键过滤按键,则终端响应用户的点击操作将网页中显示的非常规元素进行过滤;当用户右键点击该一键过滤按键,可以对交互入口及终端产品进行日志查看、产品及功能设置,退出等操作。
此外,用户可以设置交互入口的界面,使得该交互入口可以实现对渲染后的网页中存在的非常规元素进行部分过滤,比如分组过滤。用户还可以拖动交互入口的界面,从而对交互入口的位置进行移动、更改。
步骤308,获取对交互入口的触发操作,响应该触发操作将非常规元素进行过滤。
本实施例中,当用户需要对渲染后的网页中显示的非常规元素进行过滤时,可触发交互入口,例如点击一键过滤按键,终端响应对一键过滤按键的触发操作调用该交互入口,从而将在渲染后的网页中显示的非常规元素进行过滤。
此外,除了上面描述的可一键过滤所有影响阅读正常内容的非常规元素,用户可根据在渲染后的网页中显示的非常规元素的具体内容,对这些非常规元素进行分组过滤操作。比如,根据需要过滤一组或多组非常规元素。并且,用户可以进一步设置交互入口的功能,以恢复已经过滤的非常规元素。
本实施例中,通过检测网页渲染后的网页元素中是否存在非常规元素,如果网页元素中存在非常规元素,则在网页中生成交互入口并显示,在获取到对交互入口的触发操作时将非常规元素进行过滤。由于在网页渲染后还能对网页中存在的非常规元素进行过滤,并且是在获取到用户操作后进行过滤,因此可以实现对网页中显示的非常规元素进行过滤操作,即使网页中的正常内容和非常规元素经常随机变化,只要网页渲染后非常规元素存在网页中,就可以通过用户操作过滤掉非常规元素,从而使得网页中的非常规元素的过滤更为精确。
在一个实施例中,检测网页元素中是否存在非常规元素,包括:查找待访问网页所属的域名是否存在对应的预设的网页元素关键属性,若是,则检测查找到的网页元素关键属性是否有至少一条存在于待访问网页中;如果查找到的网页元素关键属性有至少一条存在于待访问网页中,则网页元素中存在非常规元素,否则网页元素中不存在非常规元素。
进一步的,在一个实施例中,查找待访问网页所属的域名是否存在对应的预设的网页元素关键属性,包括:查找待访问网页的网址的域名是否存在对应的预设的 网页元素关键属性,若是,则进入检测查找到的网页元素关键属性是否有至少一条存在于所述待访问网页中的步骤,否则,进一步查找待访问网页的网址的顶级域名是否存在对应的预设的网页元素关键属性,若是,则进入检测查找到的网页元素关键属性是否有至少一条存在于待访问网页的步骤,否则网页元素中不存在非常规元素。
具体的,在一个实施例中,如图4所示,检测网页元素中是否存在非常规元素的步骤,包括:
步骤402,查找待访问网页的网址的域名是否存在对应的预设的网页元素关键属性,若是,则进入步骤406,否则进入步骤404。
本实施例中,预先设置了网页元素关键属性,所设置的网页元素关键属性是非常规元素的属性特征。具体的,所设置的网页元素关键属性包括Class属性和id属性。在其他实施例中,还可包括style属性或其它属性。本实施例中,还预先设置了域名与网页元素关键属性的对应关系,该对应关系表明了该域名下的网址会存在非常规元素。进一步的,该对应关系可存储在服务器(云端),或者终端本地,或同时存储在服务器和终端本地。当服务器有更新时可同步更新至终端。终端可先根据在本地存储的域名与网页元素关键属性的对应关系,查找待访问网页的网址的域名是否存在对应的预设的网页元素关键属性,若查找到则进入步骤404,若查找不到,则可进一步在服务器上进行查找,如果在服务器中查找到则进入步骤404,如果在服务器中查找不到则进入步骤406。
步骤404,查找待访问网页的网址的顶级域名是否存在对应的预设的网页元素关键属性,若是,则进入步骤406,否则进入步骤408。
本实施例中,如果待访问网页的网址的域名不存在对应的预设的网页元素关键属性,则可进一步查找待访问网页的网址的顶级域名是否存在对应的预设的网页元素关键属性。如上所述,预先设置了域名与网页元素关键属性的对应关系,如果待访问网页的网址的顶级域名存在对应的预设的网页元素关键属性,则表明该待访问网页也可能存在非常规元素。具体的,终端也可先在本地查找待访问网页的网址的 顶级域名是否存在对应的预设的网页元素关键属性,若查找到则进入步骤406,若查找不到则可进一步在服务器上进行查找,如果在服务器中查找到则进入步骤406,否则进入步骤408。
步骤406,检测查找到的网页元素关键属性是否有至少一条存在于待访问网页中,若是,则进入步骤410,否则进入步骤408。
步骤408,网页渲染后得到的网页元素中不存在非常规元素。
步骤410,网页渲染后得到的网页元素中存在非常规元素。
本实施例中,当待访问网页的网址的域名或顶级域名存在对应的预设的网页元素关键属性,则检测查找到的网页元素关键属性是否有至少一条存在于待访问网页中,即:将查找到的预设的网页元素关键属性与待访问网页进行网页渲染后得到的网页元素中的关键属性进行匹配,如果匹配到至少一条关键属性,则表明根据域名匹配到的非常规元素包含待访问网页中存在的非常规元素,待访问网页存在非常规元素。如果匹配不到至少一条关键属性,则待访问网页不存在非常规元素。
具体的,预设的网页元素关键属性包括Class属性、id属性、style属性和其它属性等,在匹配待访问网页中的网页元素时,则可逐一匹配这些属性。例如,某个网页中的非常规元素代码为:<div id=“wAdFlyBlttom”class=“onlyPc”>…</div>,预先设置与域名对应的网页元素关键属性为:div[id=“wAdFlyBlttom”]或者div[class=“onlyPc”],则可以匹配到待访问网页中存在非常规元素。
本实施例中,通过将待访问网页所属的域名与预设的域名匹配,匹配得到非常规元素的网页元素关键属性,然后检测匹配到的网页元素关键属性是否存在于待访问网页中,如果存在,则表明待访问网页中存在非常规元素,否则不存在非常规元素。由于服务器中或终端本地存储的用来匹配的网页元素关键属性有可能过期,通过两次匹配过程可以确保待访问网页中匹配到的关键属性正是预设的确定为非常规元素的关键属性,因此可以确保检测待访问网页中的非常规元素的准确性。
在一个实施例中,如果渲染后得到的网页元素中存在非常规元素,则在网页中生成交互入口并显示,包括:如果网页元素中存在非常规元素,则在待访问网页的 已经渲染的页面中注入预设的JS代码,通过JS代码在网页中生成交互入口并显示,该JS代码还用于响应交互入口的触发操作将非常规元素全部过滤,或者分组过滤。
在一个实施例中,响应触发操作将非常规元素进行过滤,包括:获取非常规元素在网页中的位置大小信息,以及获取交互入口在网页中的位置大小信息;根据非常规元素在网页中的位置大小信息和交互入口在网页中的位置大小信息,将非常规元素按照预设动画效果移动至交互入口对应的位置处直至消失。
如图5所示,在一个实施例中,提供了一种网页处理方法,该方法以应用于如图1或图2中的终端中进行举例说明,包括:
步骤502,获取待访问网页进行网页渲染后的网页元素。
本实施例中,终端发起URL请求后进行网页加载、网页解析和网页渲染过程,当网页内的所有预执行的JS脚本执行过程完成,则整个页面完成加载,用户可以看到完整的网页页面。在进行网页渲染前可对网页中存在的一些非常规元素进行拦截操作,拦截掉一些非常规元素后再进行网页渲染。网页渲染后就即可显示整个网页页面,网页页面中显示了网页元素,这些网页元素除了包含正常显示的网页内容外,还可能包含了一些非常规元素。
步骤504,检测该网页元素中是否存在非常规元素,若是,则进入步骤506,否则结束。
具体的,可通过将待访问网页所属的域名与终端本地存储的域名进行匹配,匹配到域名后,获取预设的与该域名对应的网页元素关键属性。如果匹配不到,则去服务器匹配域名,从而获取到与待访问网页所属的域名对应的预设的网页元素关键属性。其中,待访问网页所属的域名包括待访问网页的网址的域名和顶级域名。在匹配时,首先对待访问网页的网址的域名进行匹配,匹配不到时再进一步对待访问网页的网址的顶级域名进行匹配。
进一步的,匹配到对应的预设的网页元素关键属性后,检测该网页元素关键属性是否有至少一条存在于待访问网页中,若是则表明匹配到的网页元素关键属性包含了待访问网页中的网页元素关键属性,待访问网页存在非常规元素,否则待访问 网页不存在非常规元素。
步骤506,在待访问网页的页面中注入预设的JS代码,通过JS代码在网页中生成交互入口并显示。
本实施例中,可在网页浏览器中注入浏览器插件,该浏览器插件可用于当网页渲染后检测渲染后得到的网页元素中是否存在非常规元素,如果存在,则向页面注入预设的JS代码,该JS代码可实现在网页中生成一个交互入口并实现该交互入口的功能交互实现。
具体的,交互入口可以是一个用来过滤网页中的非常规元素的入口,例如,可以是在页面中显示的一个控件,比如是一个一键过滤按钮。如图6所示,网页渲染后显示整个网页页面,该页面中存在一些非常规元素602,非常规元素602可以是广告内容、虚假内容或者其他与网页主题无关的内容。当检测到这些非常规元素602时在页面中生成一个一键过滤按钮604,该一键过滤按钮604可为如图6所示的一个图标。
步骤508,获取对交互入口的触发操作,响应触发操作将网页中的非常规元素移动至交互入口对应的位置处直至消失。
本实施例中,可通过注入到页面中的预设的JS代码实现交互入口的功能交互实现。具体的,当用户触发交互入口时,例如,点击一键过滤按钮604,通过预设的JS代码响应该操作,进而获取到非常规元素在网页中的位置大小信息,以及获取交互入口在网页中的位置大小信息,根据非常规元素在网页中的位置大小信息和交互入口在网页中的位置大小信息,将非常规元素按照预设动画效果移动至交互入口对应的位置处直至消失。
具体的,在检测到待访问网页中存在非常规元素时,可根据匹配的网页元素关键属性获取到这些非常规元素,进而获取到非常规元素的位置大小信息。而交互入口的位置大小信息可根据预设的JS代码获取得到。进一步的,可根据非常规元素的位置大小信息和交互入口的位置大小信息获取到每个非常规元素与交互入口之间的距离,根据该距离将每个非常规元素移动到交互入口的位置处,然后隐藏消失。
进一步的,在移动每个非常规元素到交互入口位置处的过程中,可逐渐缩小非常规元素的大小,直至达到交互入口位置处消失,以实现非常规元素动态移动并且逐渐缩小直至消失的动画效果。具体的,可采用如下方式实现这一动画效果:假设非常规元素为A,大小为Sa,交互入口为B,根据A和B的位置计算得到A与B之间的距离为L,预先设置该动画效果总时间为T,设置定时器的时间间隔为t秒(即每t秒定时器执行1次)。则非常规元素A向交互入口B移动的总次数为n=T/t。定时器每执行一次,则A向B移动距离L△=L/n,同时将非常规元素A缩放m倍数:m=Sa/n,且最后一次执行将A的大小Sa置为0,并将其设置为隐藏。这样,每个非常规元素A平移到交互入口B的位置处则会消失。如图7所示,可通过一定的动画效果实现非常规元素的过滤,非常规元素平移到交互入口位置处并逐渐缩小直至消失在交互入口位置处,在回收非常规元素的过程中,交互入口可以呈现出一种回收的动画效果,从而实现了一种将非常规元素进行回收的显示效果。
本实施例中,通过设置浏览器插件,在检测到网页渲染后得到的网页元素中存在非常规元素,则显示交互入口。由于网页渲染后整个页面加载完毕,用户也可以看到网页中存在的非常规元素,因此可以选择是否将页面中的非常规元素进行过滤。当用户选择过滤时,可通过交互入口一键触发过滤网页中显示的非常规元素。且可通过一定的动画效果来实现将非常规元素平移到交互入口位置处直至消失,实现将网页中显示的非常规元素进行回收的效果。
如图8所示,在一个实施例中,还提供了一种网页处理装置,该装置包括:
网页元素获取模块802,用于获取待访问网页进行网页渲染后的网页元素。
非常规元素检测模块804,用于检测网页元素中是否存在非常规元素。
图标生成模块806,用于如果检测到网页元素中存在非常规元素,则在网页中生成交互入口并显示。
过滤模块808,用于获取对交互入口的触发操作,响应触发操作将非常规元素进行过滤。
在一个实施例中,如图9所示,非常规元素检测模块804包括:
查找模块814,用于查找待访问网页所属的域名是否存在对应的预设的网页元素关键属性。
检测模块824,用于如果待访问网页所属的域名存在对应的预设的网页元素关键属性,则检测查找到的网页元素关键属性是否有至少一条存在于待访问网页中;如果查找到的网页元素关键属性有至少一条存在于待访问网页中,则网页元素中存在非常规元素,否则,网页元素中不存在非常规元素。
在一个实施例中,查找模块814用于查找待访问网页的网址的域名是否存在对应的预设的网页元素关键属性;检测模块824还用于,如果查找模块814检测到待访问网页的网址的域名存在对应的预设的网页元素关键属性,则检测网页元素关键属性是否有至少一条存在于待访问网页。本实施例中,查找模块814还用于,如果查找不到待访问网页的网址的域名存在对应的网页元素关键属性,则进一步查找待访问网页的网址的顶级域名是否存在对应的预设的网页元素关键属性。本实施例中,检测模块824还用于,如果查找到待访问网页的网址的顶级域名存在对应的预设的网页元素关键属性,则检测查找到的网页元素关键属性是否有至少一条存在于待访问网页中,否则网页元素中不存在非常规元素。
在一个实施例中,图标生成模块806用于,如果网页元素中存在非常规元素,则在待访问网页的页面中注入预设的JS代码,通过JS代码在网页中生成交互入口并显示,该JS代码还用于响应交互入口的触发操作将非常规元素进行过滤。
在一个实施例中,过滤模块808用于获取非常规元素在网页中的位置大小信息,以及获取交互入口在网页中的位置大小信息,根据非常规元素在网页中的位置大小信息和交互入口在网页中的位置大小信息,将非常规元素按照预设动画效果移动至交互入口对应的位置处直至消失。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一非易失性计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM) 等。
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。

Claims (11)

  1. 一种网页处理方法,所述方法包括:
    获取待访问网页进行网页渲染后的网页元素;
    检测所述网页元素中是否存在非常规元素;
    如果所述网页元素中存在非常规元素,则在网页中生成交互入口并显示;
    获取对所述交互入口的触发操作,响应所述触发操作将所述非常规元素进行过滤。
  2. 根据权利要求1所述的网页处理方法,其特征在于,所述检测所述网页元素中是否存在非常规元素,包括:
    查找所述待访问网页所属的域名是否存在对应的预设的网页元素关键属性,若是,则检测查找到的所述网页元素关键属性是否有至少一条存在于所述待访问网页中;
    如果所述查找到的网页元素关键属性有至少一条存在于所述待访问网页中,则所述网页元素中存在非常规元素,否则,所述网页元素中不存在非常规元素。
  3. 根据权利要求2所述的网页处理方法,其特征在于,所述查找待访问网页所属的域名是否存在对应的预设的网页元素关键属性,包括:
    查找待访问网页的网址的域名是否存在对应的预设的网页元素关键属性,若是,则进入检测查找到的所述网页元素关键属性是否有至少一条存在于所述待访问网页中的步骤,否则,进一步查找待访问网页的网址的顶级域名是否存在对应的预设的网页元素关键属性,若是,则进入检测查找到的所述网页元素关键属性是否有至少一条存在于所述待访问网页的步骤,否则所述网页元素中不存在非常规元素。
  4. 根据权利要求1所述的网页处理方法,其特征在于,所述如果所述网页元素中存在非常规元素,则在网页中生成交互入口并显示,包括:
    如果所述网页元素中存在非常规元素,则在待访问网页的页面中注入预设的JS代码,通过所述JS代码在网页中生成交互入口并显示,所述JS代码还用于响应所述交互入口的触发操作将所述非常规元素进行过滤。
  5. 根据权利要求1所述的网页处理方法,其特征在于,所述响应触发操作将非常规元素进行过滤,包括:
    获取所述非常规元素在网页中的位置大小信息,以及获取所述交互入口在网页中的位置大小信息;
    根据所述非常规元素在网页中的位置大小信息和所述交互入口在网页中的位置大小信息,将所述非常规元素按照预设动画效果移动至所述交互入口对应的位置处直至消失。
  6. 一种网页处理装置,其特征在于,所述装置包括处理器和存储器,所述存储器中存储可被所述处理器执行的指令,当执行所述指令时,所述处理器用于:
    获取待访问网页进行网页渲染后的网页元素;
    检测所述网页元素中是否存在非常规元素;
    如果所述网页元素中存在非常规元素,则在网页中生成交互入口并显示;
    获取对所述交互入口的触发操作,响应所述触发操作将所述非常规元素进行过滤。
  7. 根据权利要求6所述的网页处理装置,其特征在于,当执行所述指令时,所述处理器进一步用于:
    查找所述待访问网页所属的域名是否存在对应的预设的网页元素关键属性;
    如果所述待访问网页所属的域名存在对应的预设的网页元素关键属性,则检测查找到的所述网页元素关键属性是否有至少一条存在于所述待访问网页中;如果查找到的所述网页元素关键属性有至少一条存在于所述待访问网页中,则所述网页元素中存在非常规元素,否则,所述网页元素中不存在非常规元素。
  8. 根据权利要求7所述的网页处理装置,其特征在于,当执行所述指令时,所述处理器进一步用于:
    查找待访问网页的网址的域名是否存在对应的预设的网页元素关键属性;
    如果查找到所述待访问网页的网址的域名存在对应的预设的网页元素关键属性,则检测所述网页元素关键属性是否有至少一条存在于所述待访问网页;
    如果查找不到所述待访问网页的网址的域名存在对应的网页元素关键属性,则进一步查找待访问网页的网址的顶级域名是否存在对应的预设的网页元素关键属性;
    如果查找到所述待访问网页的网址的顶级域名存在对应的预设的网页元素关键属性,则检测查找到的所述网页元素关键属性是否有至少一条存在于所述待访问网页中,否则所述网页元素中不存在非常规元素。
  9. 根据权利要求6所述的网页处理装置,其特征在于,当执行所述指令时,所述处理器进一步用于:
    如果所述网页元素中存在非常规元素,则在待访问网页的页面中注入预设的JS代码,通过所述JS代码在网页中生成交互入口并显示,所述JS代码还用于响应交互入口的触发操作将所述非常规元素进行过滤。
  10. 根据权利要求6所述的网页处理装置,其特征在于,当执行所述指令时,所述处理器进一步用于:
    获取所述非常规元素在网页中的位置大小信息,以及获取所述交互入口在网页中的位置大小信息,根据所述非常规元素在网页中的位置大小信息和所述交互入口在网页中的位置大小信息,将所述非常规元素按照预设动画效果移动至所述交互入口对应的位置处直至消失。
  11. 一种非易失性计算机存储介质,其特征在于,其中存储有计算机程序,该计算机程序用于执行所述权利要求1至5任一项所述的方法。
PCT/CN2017/109037 2016-11-10 2017-11-02 网页处理方法、装置和存储介质 WO2018086476A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US16/299,883 US10726135B2 (en) 2016-11-10 2019-03-12 Web page processing method and apparatus, and storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610989440.3 2016-11-10
CN201610989440.3A CN106708502B (zh) 2016-11-10 2016-11-10 网页处理方法和装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/299,883 Continuation US10726135B2 (en) 2016-11-10 2019-03-12 Web page processing method and apparatus, and storage medium

Publications (1)

Publication Number Publication Date
WO2018086476A1 true WO2018086476A1 (zh) 2018-05-17

Family

ID=58940889

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/109037 WO2018086476A1 (zh) 2016-11-10 2017-11-02 网页处理方法、装置和存储介质

Country Status (3)

Country Link
US (1) US10726135B2 (zh)
CN (1) CN106708502B (zh)
WO (1) WO2018086476A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111401416A (zh) * 2020-03-05 2020-07-10 支付宝(杭州)信息技术有限公司 异常网站的识别方法、装置和异常对抗行为的识别方法

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106708502B (zh) 2016-11-10 2022-04-29 腾讯科技(深圳)有限公司 网页处理方法和装置
CN110297751A (zh) * 2018-03-22 2019-10-01 博彦科技(上海)有限公司 页面元素的检测方法、装置、存储介质及处理器
CN109814782A (zh) * 2018-11-22 2019-05-28 北京金山云网络技术有限公司 图片切换方法、装置和终端设备
CN110427935B (zh) * 2019-06-28 2023-06-20 华为技术有限公司 一种网页元素识别的方法及服务器
CN111125603B (zh) * 2019-12-27 2023-06-27 百度时代网络技术(北京)有限公司 网页场景识别方法、装置、电子设备及存储介质
CN116049551B (zh) * 2023-01-13 2023-08-25 北京景安云信科技有限公司 网页操作的识别管控系统

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110078558A1 (en) * 2009-09-30 2011-03-31 International Business Machines Corporation Method and system for identifying advertisement in web page
CN103327104A (zh) * 2013-06-25 2013-09-25 天津汉柏汉安信息技术有限公司 一种网页广告过滤后对客户端呈现的方法
CN103729784A (zh) * 2014-01-26 2014-04-16 合一信息技术(北京)有限公司 交互式的广告管理的方法及系统
CN104572798A (zh) * 2014-07-25 2015-04-29 上海二三四五网络科技有限公司 一种用于处理网页的方法、设备与系统
CN106095869A (zh) * 2016-06-03 2016-11-09 腾讯科技(深圳)有限公司 广告信息处理方法、用户设备、后台服务器及系统
CN106708502A (zh) * 2016-11-10 2017-05-24 腾讯科技(深圳)有限公司 网页处理方法和装置

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9147210B2 (en) * 2009-07-29 2015-09-29 Paypal, Inc. System and a machine-readable medium for processing an on-line payment without authenticating the user
US10354004B2 (en) * 2012-06-07 2019-07-16 Apple Inc. Intelligent presentation of documents
US9053493B2 (en) * 2012-08-13 2015-06-09 Google Inc. Affecting display of content based on negative reactions
CN103970395A (zh) * 2013-01-30 2014-08-06 腾讯科技(深圳)有限公司 关闭后台程序的方法和装置
CN104216929A (zh) * 2013-07-11 2014-12-17 腾讯科技(深圳)有限公司 一种页面元素的拦截方法和装置
US20160350798A1 (en) * 2015-05-26 2016-12-01 adResponse UG Method and system for managing access to advertisements on web pages
US20170060986A1 (en) * 2015-08-31 2017-03-02 Shine Security Ltd. Systems and methods for detection of content of a predefined content category in a network document
CN105701154B (zh) * 2015-12-29 2019-04-09 腾讯科技(深圳)有限公司 广告清除方法和装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110078558A1 (en) * 2009-09-30 2011-03-31 International Business Machines Corporation Method and system for identifying advertisement in web page
CN103327104A (zh) * 2013-06-25 2013-09-25 天津汉柏汉安信息技术有限公司 一种网页广告过滤后对客户端呈现的方法
CN103729784A (zh) * 2014-01-26 2014-04-16 合一信息技术(北京)有限公司 交互式的广告管理的方法及系统
CN104572798A (zh) * 2014-07-25 2015-04-29 上海二三四五网络科技有限公司 一种用于处理网页的方法、设备与系统
CN106095869A (zh) * 2016-06-03 2016-11-09 腾讯科技(深圳)有限公司 广告信息处理方法、用户设备、后台服务器及系统
CN106708502A (zh) * 2016-11-10 2017-05-24 腾讯科技(深圳)有限公司 网页处理方法和装置

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111401416A (zh) * 2020-03-05 2020-07-10 支付宝(杭州)信息技术有限公司 异常网站的识别方法、装置和异常对抗行为的识别方法
CN111401416B (zh) * 2020-03-05 2022-10-21 支付宝(杭州)信息技术有限公司 异常网站的识别方法、装置和异常对抗行为的识别方法

Also Published As

Publication number Publication date
CN106708502A (zh) 2017-05-24
CN106708502B (zh) 2022-04-29
US20190205546A1 (en) 2019-07-04
US10726135B2 (en) 2020-07-28

Similar Documents

Publication Publication Date Title
WO2018086476A1 (zh) 网页处理方法、装置和存储介质
US9424424B2 (en) Client based local malware detection method
US10187419B2 (en) Method and system for processing notification messages of a website
US10484424B2 (en) Method and system for security protection of account information
US8914496B1 (en) Tracking user behavior relative to a network page
US9602520B2 (en) Preventing URL confusion attacks
US20130212465A1 (en) Postponed rendering of select web page elements
CN106033450B (zh) 一种广告拦截的方法、装置和浏览器
CN102664925B (zh) 一种展现搜索结果的方法及装置
WO2020118485A1 (en) Method of Detecting User Interface Layout Issues for Web Applications
US20230259637A1 (en) Detecting Injection Vulnerabilities of Client-Side Templating Systems
EP2959401A1 (en) Presentation of user interface elements based on rules
CN106844635A (zh) 网页中的元素的编辑方法及装置
US20130080871A1 (en) Method for retrieving a representation of an annotated web document, associated computer program and electronic device
CN104991896A (zh) 一种解析二维码的方法与装置
WO2014040534A1 (en) Method and apparatus for manipulating and presenting images included in webpages
WO2012006916A1 (zh) 在网页上实现手写输入的方法及系统
CN111783019A (zh) 浏览器子页面创建方法、装置、计算机设备和存储介质
WO2016019105A1 (en) Method and system for testing page link addresses
US10218767B2 (en) Method, system and browser for executing active object of browser
CN107220371A (zh) 页面显示方法、装置及存储介质
WO2018137470A1 (zh) 用户终端及网页图片资源加载装置与方法、存储介质
WO2018058330A1 (zh) 广告拦截的方法、装置和浏览器、计算机存储介质
CN104965926B (zh) 网页提供方法及装置
US20180225036A1 (en) Web application with adaptive user interface

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17869057

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17869057

Country of ref document: EP

Kind code of ref document: A1