【发布时间】:2021-09-19 04:27:25
【问题描述】:
我正在尝试在 Windows7 企业版中运行 selenium chrome 无头模式。我有:
from selenium.webdriver.chrome.options import Options
options = Options()
options.add_argument('--headless')
options.add_argument('--disable-gpu')
options.add_argument('window-size = 1920,1080')
driver = webdriver.Chrome(executable_path="chromedriver.exe", options=options)
我明白了:
chrome.exe is no longer running, so ChromeDriver is assuming that Chrome has crashed
同一组命令在我的 mac book pro 上完美运行 谁知道为什么?
【问题讨论】:
-
看起来问题在这里
executable_path="chromedriver.exe" -
能否分享一下chrome驱动版本和chrome浏览器版本?
-
我的 Chrome 浏览器 = 91.0.4472.124
-
chrome 驱动程序 = 91.0.4472.101
-
它们是最新的,因此我们可以排除驱动程序不匹配的问题
标签: python selenium google-chrome headless