我正在使用 Selenium 和 Python 来实现一些在线相机接口。问题是我似乎无法在 Selenium 的 Chrome 中激活 Flash。
我发现问题与我接近,但没有一个解决方案有效: https://sqa.stackexchange.com/questions/30312/enable-flash-player-on-chrome-62-while-running-selenium-test
我尝试的所有参数都没有改变任何内容,我得到的只是“获取 Flash Player”链接
这是我的代码:
chrome_options = Options()
prefs = {
"profile.default_content_setting_values.plugins" : "1",
"profile.content_settings.exceptions.plugins.*,*.per_resource.adobe-flash-
player" : "1",
"PluginsAllowedForUrls": "ADRESS"
//The player is in a frame, I tried to pass both the host and the framed page
}
chrome_options.add_argument("--disable-web-security")
chrome_options.add_argument("--allow-running-insecure-content")
chrome_options.add_experimental_option("prefs",prefs)
driver = webdriver.Chrome(chrome_options=chrome_options)
Run Code Online (Sandbox Code Playgroud)
谢谢