Set chrome.prefs with python binding for selenium in chromedriver

前端 未结 5 1185
我寻月下人不归
我寻月下人不归 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:34

    This is what works with latest chromedriver versions from at least 2.15 to the current version 2.20:

    chrome_options = Options()
    chrome_options.add_experimental_option( "prefs", {'profile.managed_default_content_settings.images': 2})
    chrome = webdriver.Chrome('/path/to/chromedriver',chrome_options=chrome_options)
    chrome.get("https://google.com")
    

提交回复
热议问题