selenium
2019-10-09 本文已影响0人
wang_souris
from selenium import webdriver
chrome_opt = webdriver.ChromeOptions()
chrome_opt.add_argument('--headless') #设置chrome无头模式
prefs={"profile.managed_default_content_settings.images":2}
chrome_opt.add_experimental_option("prefs",prefs)
browser = webdriver.Chrome(executable_path="C:\\Program Files (x86)\\Google\\Chrome\\Application\\chromedriver.exe",chrome_options=chrome_opt)
browser.get(url)