如果我们分析日志,似乎主要问题在于in 和随后的错误消息 。
因此,从错误中很明显,Python客户端无法找到 二进制文件。
您必须在这里注意以下几点:
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
chrome_options = Options()
chrome_options.add_argument("--headless")
driver = webdriver.Chrome(chrome_options=chrome_options, executable_path=r'C:\Utility\BrowserDrivers\chromedriver.exe')
driver.get("http://www.duo.com")
print("Chrome Browser Initialized in Headless Mode")
driver.quit()
print("Driver Exited")