Created
June 22, 2020 14:56
-
-
Save kasuganosoras/86be4f231426580874798a6ba2e30b77 to your computer and use it in GitHub Desktop.
去掉百度的反爬虫内容
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Fuck Baidu Zhidao | |
// @namespace http://www.baidu.com/ | |
// @version 0.1 | |
// @description try to fuck over the baidu! | |
// @author Baidu | |
// @match https://zhidao.baidu.com/question/*.html | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
var answer_list = document.querySelectorAll('.answer-text'); | |
for(var i = 0;i < answer_list.length;i++) { | |
var list = answer_list[i].querySelectorAll('span'); | |
for(var k = 0;k < list.length;k++) { | |
if(list[k].offsetHeight <= 1) { | |
list[k].remove(); | |
} | |
} | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment