美文网首页
selenium 自动加载flash

selenium 自动加载flash

作者: HHHHUA | 来源:发表于2019-11-20 18:33 被阅读0次

    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)

    相关文章

      网友评论

          本文标题:selenium 自动加载flash

          本文链接:https://www.haomeiwen.com/subject/fscaictx.html