python - 在 Python 中使用 Chromedriver 启用 Flash

标签 python selenium flash selenium-chromedriver

尝试使用 python 在 chromedriver 中启用 Adob​​e Flash Player。我已经进行了多次尝试,包括:

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
}

以及我从有关此问题的热门 Google 结果中发现的一些其他变体。

最佳答案

最终用以下代码解决了这个问题:

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)

关于python - 在 Python 中使用 Chromedriver 启用 Flash,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48468305/

相关文章:

javascript - 如何检测正在播放的 Flash 视频的时间

python - 允许程序取最接近时间的值的函数

java - 为了让一个用户通过网站从另一位用户的计算机下载文件,我需要编写什么代码?

python - 按创建时间排序目录

java - Selenium 项目的单元测试

java - 使用 XPath 和 Selenium for Java 获取下一个兄弟元素

python - 使用 Selenium 和 Python 执行浏览器 UI 操作

Jquery动态更改flashparam属性(config = {"playlist": ["url"] :"http://localhost/test.flv"}) of an embed tag

Python 为属性文件中的特定键设置值

python - 单击按钮时 kivy 加载相机(zbarscan)