Set chrome.prefs with python binding for selenium in chromedriver

前端 未结 5 1188
我寻月下人不归
我寻月下人不归 2020-12-04 22:37

I have been searching all day for this and it seems that there is no solution currently available from the chromedriver implementation for python.

how do you set spe

5条回答
  •  时光说笑
    2020-12-04 23:17

    For anyone who want to disable images in chromedriver, the following code might help you.

    from selenium.webdriver.chrome.options import Options
    chrome_options = Options()
    chrome_options.add_experimental_option( "prefs", {'profile.default_content_settings.images': 2})
    driver = webdriver.Chrome(chrome_options=chrome_options)
    

提交回复
热议问题