非无头模式下使用Xvfb时,Chrome无法访问

3

我遇到了以下错误:

  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)

如果我尝试运行Selenium Chromedriver而没有使用选项并使用,则会出现问题。

在无头模式下,没有可以完美运行。 我需要,因为我需要它不在无头模式下运行浏览器扩展程序,否则将不受支持。

为什么会发生这种情况? 是否有任何方法可以实现我想要的结果?

1个回答

0
确保 Chrome 和 Chromedriver 版本相同。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接