chrome_options


 
用法
from selenium.webdriver.chrome.options import Options
chorme_option=Options()
chorme_option.add_argument("--disable-gpu")
chorme_option.add_argument("--disable-infobars")


#禁止图片加载,禁止推送通知
prefs = {
    "profile.default_content_setting_values" : {
        "images": 2
    },"profile.default_content_setting_values.notifications"  :  2
}
chorme_option.add_experimental_option("prefs",prefs)
chorme_option.add_argument('--ignore-certificate-errors') #SSLエラー対策
driver = webdriver.Chrome(chrome_options = chorme_option)

  

chromedriver中的浏览器选项

selenium 定制启动 chrome 的选项

 
posted @ 2018-02-18 15:20  公众号python学习开发  阅读(491)  评论(0编辑  收藏  举报