selenium chrome 自动加载flash

#coding:utf-8
from selenium import webdriver
from selenium.webdriver.support.select import Select
from selenium.webdriver.chrome.options import Options
import time

def login():
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(chrome_options=chromeOpitons)
driver.get("http://test.live.liXXXXng.com/#/login")
time.sleep(5)
# Sl = Select(driver.find_element_by_xpath('//*[@id="app"]/div[3]/select'))
# Sl.select_by_value("test")
# time.sleep(5)
login()
posted @ 2018-07-10 18:17  yanhuidj  阅读(2150)  评论(0编辑  收藏  举报