隐藏webdriver特征

chrome_options = webdriver.ChromeOptions()

chrome_options.add_experimental_option("excludeSwitches", ["enable-automation"])

chrome_options.add_experimental_option('useAutomationExtension', False)

chrome_options.add_argument('lang=zh-CN,zh,zh-TW,en-US,en')

chrome_options.add_argument('user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36')

chrome_options.add_argument("disable-blink-features=AutomationControlled")# 就是这一行告诉chrome去掉了webdriver痕迹

driver = webdriver.Chrome(chrome_options=chrome_options)

你可能感兴趣的:(隐藏webdriver特征)