chrome 自动加载flash

class Login(unittest.TestCase):
#初始
def setUp(self):
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)
time.sleep(1)
self.driver = webdriver.Chrome(chrome_options=chromeOpitons)
time.sleep(2)
self.driver.get("http://www.youku.com")
time.sleep(2)
self.driver.maximize_window()
time.sleep(2)
posted @ 2018-07-13 16:30  yanhuidj  阅读(940)  评论(1编辑  收藏  举报