设置selenium 自动加载flash

 
  
设置浏览器自动加载爬虫
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)

你可能感兴趣的:(spider)