python +selenium+chrome关闭保存密码弹窗和关闭chrome受自动控制提示 | 您所在的位置:网站首页 › 阻止弹窗怎么取消设置密码 › python +selenium+chrome关闭保存密码弹窗和关闭chrome受自动控制提示 |
from selenium import webdriver from time import sleep import os chrome_options = webdriver.ChromeOptions() prefs = {"": “”} prefs[“credentials_enable_service”] = False prefs[“profile.password_manager_enabled”] = False chrome_options.add_experimental_option(“prefs”, prefs) ##关掉密码弹窗 chrome_options.add_argument(’–disable-gpu’) # 谷歌文档提到需要加上这个属性来规避bug chrome_options.add_argument(‘lang=zh_CN.UTF-8’) # 设置默认编码为utf-8 chrome_options.add_experimental_option(‘useAutomationExtension’, False) # 取消chrome受自动控制提示 chrome_options.add_experimental_option(“excludeSwitches”, [‘enable-automation’]) # 取消chrome受自动控制提示 browser = webdriver.Chrome(os.getcwd()+"\chromedriver.exe",0, options=chrome_options) # 参数的写入 browser.get(“https://www.baidu.com”) |
CopyRight 2018-2019 实验室设备网 版权所有 |