1. 程式人生 > WINDOWS開發 >無頭模式,Windows和Linux

無頭模式,Windows和Linux

----windows

from selenium import webdriver

from selenium .webdriver.common.by import By

import ttime

chrome_options =webdriver.ChromeOptions()

chrome_options.add_argument(‘--headless‘)

chrome_options.add_argument(‘--disable-gpu‘)

chrome_options.add_argument(‘--window-size =1920,1050‘)

driver =webdriver.Chrome(options = chrome_options)