首页 > 其他分享 >selenium屏蔽启动浏览器启动时的提示信息

selenium屏蔽启动浏览器启动时的提示信息

时间:2022-12-12 14:46:13浏览次数:41  
标签:webdriver 启动 chrome selenium add 提示信息 import options

代码

from selenium import webdriver
from selenium.webdriver import Remote
from webdriver_helper import debugger, get_webdriver

chrome_options = webdriver.ChromeOptions()
chrome_options.add_experimental_option('useAutomationExtension', False)
chrome_options.add_experimental_option("excludeSwitches", ['enable-automation'])
chrome_options.add_experimental_option("prefs", {"credentials_enable_service": False,
                                                         "profile.password_manager_enabled": False,
                                                         "profile.default_content_setting_values.notifications": 2})

driver = get_webdriver(ui_setting.driver_type, options=chrome_options)  # 启动浏览器
driver.set_window_size(1680, 1050)

标签:webdriver,启动,chrome,selenium,add,提示信息,import,options
From: https://www.cnblogs.com/liuyanhang/p/16975985.html

相关文章