35
美团的反爬虫太厉害了,各种下毒😭
source link: https://www.v2ex.com/t/787555
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
41 条回复 • 2021-07-07 10:43:56 +08:00
no1xsyzy 1 天前
zhengfan2016 1 天前
zjmdp 1 天前
@yangyifan 是下面两个设置吗?
options.add_experimental_option('excludeSwitches', ['enable-automation'])
options.add_argument("disable-blink-features=AutomationControlled")
options.add_experimental_option('excludeSwitches', ['enable-automation'])
options.add_argument("disable-blink-features=AutomationControlled")
zjmdp 1 天前
@yangyifan 还有下面这段
self.driver.execute_cdp_cmd(
"Page.addScriptToEvaluateOnNewDocument",{
"source":'''
Object.defineProperty(navigator,'webdriver',{
get: () => undefined
})
'''
}
)
self.driver.execute_cdp_cmd(
"Page.addScriptToEvaluateOnNewDocument",{
"source":'''
Object.defineProperty(navigator,'webdriver',{
get: () => undefined
})
'''
}
)
yangyifan 22 小时 20 分钟前
@zjmdp 不不不, 还需要编译 chromedriver 的 源码 才可以解决。比如使用 chromedriver 浏览器 就会有这个 window.cdc_adoQpoasnfa76pfcZLmcfl_Array 属性。其实还有其他很多坑。自己慢慢去摸索吧。不止是 chromedriver,不管是无头还是有头的模式,如果没好好研究 chromium 代码,很容易就被发现。
ml1344677 15 小时 55 分钟前
曾经爬某网站,返回结果是一个不定长坐标 list,可以组成封闭图形。当触发反爬后,反爬也不屏蔽你 ip,也不返回空数据,,直接把这个 list 给乱序。。。导致每次还需要消耗资源检测是否组成封闭图形。 稳定运行了 2 天才发现。。总 list 保守估计上 10 亿计。
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK