【问题标题】:unable to run selenium chrome headless mode in Windows 7 enterprise无法在 Windows 7 企业版中运行 selenium chrome 无头模式
【发布时间】: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


【解决方案1】:

我认为你应该在这一行尝试使用完整的文件路径:

driver = webdriver.Chrome(executable_path="/full file path/chromedriver.exe", options=options)

【讨论】:

    猜你喜欢
    • 2012-08-28
    • 2023-01-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-08-12
    • 2021-07-11
    • 1970-01-01
    相关资源
    最近更新 更多