selenium防止检测,修改chromedriver.exe


用文本编辑器打开chromedriver.exe,搜索$cdc_asdjflasutopfhvcZLmcfl_这个字符串,随便改几个字母,保持相同长度就行
这是chromedriver的特征,有些检测工具(FingerprintJS, Imperva,Google’s Captcha)会检测这个变量值
还有些常规的操作,如:

option = webdriver.ChromeOptions()

#Removes navigator.webdriver flag
# For older ChromeDriver under version 79.0.3945.16
option.add_experimental_option("excludeSwitches", ["enable-automation"])
option.add_experimental_option('useAutomationExtension', False)

#For ChromeDriver version 79.0.3945.16 or over
option.add_argument('--disable-blink-features=AutomationControlled')

#Open Browser
browser = webdriver.Chrome(executable_path='chromedriver.exe',options=option)


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM