Loading

selenium去特征

code


from selenium import 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("/Users/xiaowei/Downloads/chromedriver", chrome_options=chrome_options)
# driver.get("https://bot.sannysoft.com/")
# driver.get("http://sbj.cnipa.gov.cn/")
driver.get("https://toefl.neea.cn/login")
posted @ 2021-07-11 19:55  小伟哥哥~  阅读(419)  评论(0编辑  收藏  举报