Remove some website information from Baidu search results (do not display it through js control), Baidu search js

Source: Internet
Author: User

Remove some website information from Baidu search results (do not display it through js control), Baidu search js

Sometimes some websites we don't like in the search results. In fact, don't open them if you don't like them. Why bother? but from a technical point of view, it is really good to implement through js.

Core code

Information about the customer's home and cnblogs removed from Baidu search

(Function () {var reg =/www.jb51.net \/.*? | Www.cnblogs.com \/.*? /; Var resultQuery = document. getElementsByClassName ('C-iner '); for (var I = 0; I <resultQuery. length; I ++) {var url = resultQuery [I]. getElementsByClassName ('C-showurl') [0]; url = url. innerHTML; console. log (url); if (reg. test (url) {resultQuery [I]. outerHTML = ""; console. log (I) ;}}) (); // use native js to operate dom // 20161121

Usage:

In chrome, switch to the baidu search result page and pressF12, FindConsole, Paste the above Code below, and press enter to execute.

In this way, the content of the customer's home and the cnblogs website is removed from the result on the left.

Those who do not like us will not like us no matter how we do it. Those who like us will accept us no matter what we do. Let others talk about it.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.