在Python中使用Chromedriver启用Flash [英] Enable Flash with Chromedriver in Python
本文介绍了在Python中使用Chromedriver启用Flash的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
尝试使用python在chromedriver中启用Adobe Flash Player.我经历了许多尝试,包括:
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
}
我在Google的最佳搜索结果中发现了一些与此问题有关的其他变种.
along with a few other variations that I found from the top google results regarding this issue.
推荐答案
最终使用以下代码解决了这个问题:
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)
这篇关于在Python中使用Chromedriver启用Flash的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文