1. 程式人生 > >設定selenium 自動載入flash

設定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)