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.