首页 > 代码库 > Selenium chrome配置不加载图片Python版

Selenium chrome配置不加载图片Python版

环境: windows 7 + Python 3.5.2 + Selenium 3.4.2 + Chrome Driver 2.29 + Chrome 58.0.3029.110 (64-bit)

 

from selenium import webdriver

chrome_options = webdriver.ChromeOptions()
prefs = {"profile.managed_default_content_settings.images":2}
chrome_options.add_experimental_option("prefs",prefs)
            
driver = webdriver.Chrome(chrome_options=chrome_options)

 

Selenium chrome配置不加载图片Python版