from selenium import webdriver
from selenium.webdriver.chrome.options import Options
chrome_options = Options()
chrome_options.add_argument('--headless')
chrome_options.add_argument('--disable-gpu')
#path为自己的chrome.exe位置,我这里写的是我自己电脑中的位置
path = r'C:\Users\86185\AppData\Local\Google\Chrome\Application\chrome.exe'
chrome_options.binary_location = path
browser = webdriver.Chrome(chrome_options=chrome_options)
Chrome的headless配置语句(可粘贴)
最新推荐文章于 2025-03-08 19:41:49 发布