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

问题描述

尝试在此处下载并使用此最新的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,但浏览器实例无法启动。

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)

猜你在找的技术问答相关文章

如何检查配对的蓝牙设备是打印机还是扫描仪(Android)
是否允许实体正文进行HTTP DELETE请求?
如何将ZipInputStream转换为InputStream?
java.util.logging Java 8中的变量
PowerMockito.doReturn返回null
Java中的RESTful调用
Swing / Java:如何正确使用getText和setText字符串
特殊字符和重音字符
Android Studio中的ndk.dir错误
错误“找不到主类”