diff options
Diffstat (limited to 'wfs.py')
-rwxr-xr-x | wfs.py | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -100,11 +100,16 @@ def start_wworker(driver_name): if driver_name == 'chrome': chrome_options = webdriver.chrome.options.Options() chrome_options.headless = True + chrome_options.experimental_options["prefs"] = { + "profile.default_content_setting_values.images": 2 + } DRIVER = webdriver.Chrome(options=chrome_options, desired_capabilities={'detach': True}) elif driver_name == 'firefox': + firefox_profile = webdriver.FirefoxProfile() + firefox_profile.set_preference('permissions.default.image', 2) firefox_options = webdriver.firefox.options.Options() firefox_options.headless = True - DRIVER = webdriver.Firefox(options=firefox_options) + DRIVER = webdriver.Firefox(firefox_profile=firefox_profile, options=firefox_options) else: raise Exception('unknown driver name') Finalize(DRIVER, stop_driver, exitpriority=16) |