关闭自动化“chrome正受到自动测试软件的控制”方法:
option = webdriver.ChromeOptions()
# V75以及以下版本 # option.add_argument('disable-infobars')
# V76以及以上版本 option.add_experimental_option('useAutomationExtension', False) option.add_experimental_option('excludeSwitches', ['enable-automation'])
解决浏览器会自动关闭方法:
# 不自动关闭浏览器 option.add_experimental_option("detach", True)
# 打开chrome浏览器 driver = webdriver.Chrome(chrome_options=option)
禁用浏览器弹出保存密码方法:
options = webdriver.ChromeOptions() prefs = {"":""} prefs["credentials_enable_service"] = False prefs["profile.password_manager_enabled"] = False options.add_experimental_option("prefs", prefs)