当前位置: 首页 > 面试题库 >

Selenium:WebDriverException:Chrome无法启动:由于google-chrome不再运行而崩溃,因此ChromeDriver认为Chrome已崩溃

马凡
2023-03-14
问题内容

最近,我更换了计算机,从那时起,我无法使用selenium启动铬。我也尝试过Firefox,但浏览器实例无法启动。

from selenium import webdriver

d = webdriver.Chrome('/home/PycharmProjects/chromedriver')

d.get('https://www.google.nl/')

我收到以下错误:

selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: crashed
  (unknown error: DevToolsActivePort file doesn't exist)
  (The process started from chrome location /opt/google/chrome/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
  (Driver info: chromedriver=2.43.600233, platform=Linux 4.15.0-38-generic x86_64)
我安装了最新的Chrome版本和chromedriver

编辑:尝试@ b0sss解决方案后,我得到以下错误。

selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: crashed
  (chrome not reachable)
  (The process started from chrome location /opt/google/chrome/google-chrome is no longer running, so chromedriver is assuming that Chrome has crashed.)
  (Driver info: chromedriver=2.43.600233 (523efee95e3d68b8719b3a1c83051aa63aa6b10d),platform=Linux 4.15.0-38-generic x86_64)

问题答案:

尝试在此处下载并使用此最新的chrome驱动程序版本。

https://sites.google.com/a/chromium.org/chromedriver/downloads

编辑:

尝试这个:

chrome_options = Options()
chrome_options.add_argument('--headless')
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--disable-dev-shm-usage')
d = webdriver.Chrome('/home/PycharmProjects/chromedriver',chrome_options=chrome_options)
d.get('https://www.google.nl/')


 类似资料:
  • 问题内容: 最近,我更换了计算机,从那时起,我无法使用selenium启动铬。我也尝试过Firefox,但浏览器实例无法启动。 我收到以下错误: 我安装了最新的Chrome版本和chromedriver 编辑:尝试@ b0sss解决方案后,我得到以下错误。 问题答案: 尝试在此处下载并使用此最新的chrome驱动程序版本。 https://sites.google.com/a/chromium.o

  • 我正在ubuntu服务器上运行一个jupyter笔记本。我正在尝试使用chrome驱动程序运行下面的selenium代码。我收到下面的错误,但如果我在Ubuntu终端中运行下面的代码行,它会返回下面的输出。有人知道可能是什么问题吗?我对ubuntu还是很陌生的。 Ubuntu代码: 输出: jupyter笔记本代码: 错误: 更新: 更新: Ubuntu 代码: 输出: 错误: 更新: 出于某种原

  • 我在centos上运行无头chrome,无头chrome版本2.38和google-chrome-稳定版本67.0 chrome选项: 最后一行给出以下给定错误消息: 我已经验证了chrome和chromedriver版本,它是兼容的。无法理解为什么它没有在centos上运行?同样的代码在mac上运行良好 聚甲醛

  • 问题内容: 我正在尝试使用ChromeWebDriver在Chrome上测试我的应用程序,但是每次尝试都会出现以下异常: 在chromedriver.log中,我看到了 我正在使用: 镀铬36 ChromeWebDriver 2.10 Windows 7的 在Process Explorer中,我可以看到chromedriver.exe进程正在运行,但是没有打开任何窗口,几秒钟后,我得到了上面的异

  • 问题内容: 我正在尝试使用使用 硒* 和 chromedriver的 量角器 在 Jenkins 上运行一些自动化测试。 *** 我还设置了 xvfb, 以便我们可以 无头 运行这些测试。我已经安装了 xvfb jenkins插件 ,并且可以正常工作。 我遇到的问题是,当我开始测试时,chrome不断崩溃。我收到此错误: 建立 这是我有关系统设置的信息: Chrome 位置: 版本:Chromiu

  • 每当UwAmp重启自己(例如,当我修改php.ini或切换到不同版本的php),它经常崩溃Chrome我打开的任何页面,无论是我正在UwAmp测试的页面还是完全不相关的东西比如Facebook它们是空的,我必须重新加载它们。有时它完全关闭Chrome,我必须重新启动它,我收到消息说Chrome意外关闭。什么给?这是已知的错误吗?有什么办法可以预防吗?UwAmp是如何控制Chrome的?这是在Win