首页 文章

Selenium ChromeDriver无法在python3.5中运行ubuntu

提问于
浏览
0

我收到了以下错误 . 有人可以帮助我

Traceback(最近一次调用最后一次):文件“index.py”,第38行,在browser = webdriver.Chrome(r“./ chromedriver”)#replace with> .Firefox(),或者使用您选择的浏览器File “/usr/local/lib/python3.5/dist->packages/selenium/webdriver/chrome/webdriver.py”,第75行,in init desired_capabilities = desired_capabilities)文件“/usr/local/lib/python3.5/ dist-packages / selenium / webdriver / remote / webdriver.py“,第156行,在init self.start_session(capabilities,browser_profile)文件”/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote /webdriver.py“,第245行,在start_session响应= self.execute(Command.NEW_SESSION,参数)文件”/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py“ ,第314行,执行self.error_handler.check_response(响应)文件“/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/errorhandler.py”,第242行,在check_response中引发exception_class(消息,屏幕,堆栈跟踪)selenium.common.exceptions.WebDriver例外:消息:未知错误:Chrome无法启动:异常退出(驱动程序信息:chromedriver = 2.35.528139(47ead77cb35ad2a9a83248b292151462a66cd881),platform = Linux 4.10.0-38-generic x86_64)

1 回答

  • 0

    chromdriver 无法启动您的Chrome浏览器 . 这很可能是因为使用了不兼容的Chrome浏览器版本和Chromedriver .

    您没有提到您正在使用的Selenium绑定版本或Chrome浏览器,但您的堆栈跟踪显示:

    chromedriver = 2.35.528139

    Chromedriver 2.35仅支持Chrome版本62-64 . 最新版本(目前为2.40)支持Chrome版本66-68 . 如果你升级到那个,这应该解决 .

    通常,每次Chrome升级时,您都需要将Chromedriver替换为更新的版本......或者至少检查兼容性 .

    您可以通过查看“下载”页面上的发行说明来查看Chromedriver支持的版本:http://chromedriver.chromium.org/downloads

相关问题