简体   繁体   中英

Selenium fails to run program headless

I'm attempting to run a Headless selenium session via Chrome Web Driver in python. The code I have here should be able to run it headless mode, but it runs headed and I don't get any error codes. I'm running Windows 10, Python 3.7.

from selenium import webdriver
from selenium.webdriver.chrome.options import Options

options = Options()
driver = webdriver.Chrome(options=options)
options.add_argument("--headless")

options.addArguments("headless");

在无头之前尝试不使用 -- 看看它是否有效。

你也可以使用这个:

options.headless = True

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM