python - "Chrome not reachable"在非 headless 模式下使用 X

我收到以下错误:

  File "/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 333, in get
    self.execute(Command.GET, {'url': url})
  File "/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "/python3.8/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: chrome not reachable
  (Session info: chrome=80.0.3987.122)

当我尝试在不使用 --headless 选项并使用 xvfb 的情况下运行 Selenium Chromedriver 时。

在没有 xvfb 的情况下,它可以在 headless 模式下完美运行。我需要 xvfb,因为我需要它而不是 headless 模式来运行浏览器扩展,否则不支持。

为什么会这样?有什么办法可以实现我想要的吗?

最佳答案

确保 chrome 和 chromedriver 版本相同。

关于python - "Chrome not reachable"在非 headless 模式下使用 Xvfb,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60450995/

相关文章:

json - 将 GeoJSON 文件导入 React-Leaflet

javascript - nuxt layout - 为移动端和桌面端提供不同的布局

git - 撤消 Git 中已推送到远程仓库的特定提交

django - 发出命令时出现静态错误 "python manage.py collectstat

reactjs - 清理本地存储后如何进行重定向?

c# - 如果正在使用的 USB COM 端口已被移除,SerialPort.Close() 会卡住

apache-kafka - max.request.size 和 message.max.byte

ios - GeometryReader 在 SwiftUI 中占用额外空间

javascript - 调用一次从 API 获取数据

java - 使用 Jacoco Agent 远程触发 jacoco 执行数据转储