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)
上一篇:Selenium隐藏“Chrome is being controlled by automated test software”


下一篇:Serverless 工程实践 | 细数 Serverless 的配套服务