selenium 自动加载flash

chrome

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
chromeOpitons = Options()

prefs= {
"profile.managed_default_content_settings.images":1,
"profile.content_settings.plugin_whitelist.adobe-flash-player":1,
"profile.content_settings.exceptions.plugins.,.per_resource.adobe-flash-player":1,

}

chromeOpitons.add_experimental_option('prefs', prefs)

driver = webdriver.Chrome('./chromedriver', chrome_options=chromeOpitons)

Firefox

option = webdriver.FirefoxProfile()
option.set_preference("plugin.state.flash", 2)
driver = webdriver.Firefox(option)

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容