编程语言
首页 > 编程语言> > python, selenium 之屏蔽提示框

python, selenium 之屏蔽提示框

作者:互联网

1、Win10 64位系统、谷歌版本79.0.3945.88、PYTHON版本3.7.5

chrome_option_set = webdriver.ChromeOptions()
chrome_option_set.add_experimental_option("excludeSwitches", ['enable-automation']) # 屏蔽'CHROME正受到组件控制'的提示

prefs = {"":""}
prefs["credentials_enable_service"] = False
prefs["profile.password_manager_enabled"] = False
chrome_option_set.add_experimental_option("prefs", prefs) # 屏蔽'保存密码'提示框

browser = webdriver.Chrome(executable_path=chrome_driver,chrome_options=chrome_option_set)
'''

Map<String, Object> prefs = new HashMap<String, Object>();
prefs.put("credentials_enable_service", false);
prefs.put("profile.password_manager_enabled", false);
options.setExperimentalOption("prefs", prefs);
WebDriver driver = new ChromeDriver(options);

'''

https://www.cnblogs.com/liuxianan/p/disable-chrome-extension-warning.html 屏蔽请停用以开发者模式运行的扩展程序”提示

标签:提示框,option,python,enable,selenium,chrome,屏蔽,set,prefs
来源: https://www.cnblogs.com/yimai-series/p/12090750.html