Skip to content

Instantly share code, notes, and snippets.

@UZziell
Last active October 8, 2020 09:19
Show Gist options
  • Save UZziell/ffcff3f14df9bf3df9ad16b7912770de to your computer and use it in GitHub Desktop.
Save UZziell/ffcff3f14df9bf3df9ad16b7912770de to your computer and use it in GitHub Desktop.
Allow certain urls to run flash using chromedriver and selenium
# Tested on Chrome Version 86.0.4240.75 (Official Build) (64-bit)
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
options = Options()
prefs = {
"profile.default_content_setting_values.plugins": 1,
"profile.managed_plugins_allowed_for_urls": ["https://example.com", "https://www.whatismybrowser.com:443"],
"plugins.run_all_flash_in_allow_mode": True,
}
options.add_experimental_option("prefs", prefs)
browser = webdriver.Chrome(options=options)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment