Search code examples
pythonseleniumflashselenium-chromedriver

Enable Flash with Chromedriver in Python


Trying to enable Adobe Flash Player in chromedriver using python. I've gone through a number of attempts including:

prefs = {'plugins.plugins_enabled': 'Adobe Flash Player'}

prefs = {'plugins.plugins_list' : [{'enabled':True,'name':'Adobe Flash 
Player'}]}

prefs = {
    'profile.default_content_setting_values.plugins': 1,
    'profile.content_settings.plugin_whitelist.adobe-flash-player': 1
}

along with a few other variations that I found from the top google results regarding this issue.


Solution

  • Ended up solving this with the following code:

    prefs = {
        "profile.default_content_setting_values.plugins": 1,
        "profile.content_settings.plugin_whitelist.adobe-flash-player": 1,
        "profile.content_settings.exceptions.plugins.*,*.per_resource.adobe-flash-
         player": 1,
        "PluginsAllowedForUrls": "https://url.com"
    }
    
    options.add_experimental_option("prefs",prefs)