Python——调用webdriver.Chrome() 报错

这篇具有很好参考价值的文章主要介绍了Python——调用webdriver.Chrome() 报错。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

今天运行脚本,报错内容如下:

webdriver.chrome()报错,python,python,chrome,开发语言

 collecting ... 
login_case.py:None (login_case.py)
login_case.py:11: in <module>
    dr = webdriver.Chrome()
D:\Program Files (x86)\Python\Python39\Lib\site-packages\selenium\webdriver\chrome\webdriver.py:76: in __init__
    RemoteWebDriver.__init__(
D:\Program Files (x86)\Python\Python39\Lib\site-packages\selenium\webdriver\remote\webdriver.py:157: in __init__
    self.start_session(capabilities, browser_profile)
D:\Program Files (x86)\Python\Python39\Lib\site-packages\selenium\webdriver\remote\webdriver.py:252: in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
D:\Program Files (x86)\Python\Python39\Lib\site-packages\selenium\webdriver\remote\webdriver.py:321: in execute
    self.error_handler.check_response(response)
D:\Program Files (x86)\Python\Python39\Lib\site-packages\selenium\webdriver\remote\errorhandler.py:242: in check_response
    raise exception_class(message, screen, stacktrace)
E   selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 97
E   Current browser version is 115.0.5790.110 with binary path C:\Users\Administrator\AppData\Local\Google\Chrome\Application\chrome.exe

collected 0 items / 1 error

【报错翻译】This version of ChromeDriver only supports Chrome version 97。此版本的ChromeDriver仅支持Chrome版本97,需要升级Chrome驱动版本WebDriver。

【原因】:

ChromeDriver驱动需要对应的浏览器版本,而当前安装的浏览器版本太低

【解决办法】:

方法1.  更新与当前安装Chrome浏览器版本相对应的driver。

【具体步骤】

查看本机电脑已安装的Chrome版本为115版本。

webdriver.chrome()报错,python,python,chrome,开发语言

 打开chromedriver下载地址 https://chromedriver.storage.googleapis.com/index.html,找到115版本对应的驱动,下载安装包。

安装包解压后放进Python的安装路径下:

webdriver.chrome()报错,python,python,chrome,开发语言

方法2: 安装旧版本并关闭谷歌浏览器自动更新功能。

仅阐述关闭谷歌浏览器自动升级功能,防止再次发生此类情况。

右键单击【我的电脑】——【管理】——【计算机管理本地】——【系统工具】——【任务计划程序】——【任务计划程序库】——这里找到两个和Google自动更新相关的任务计划【GoogleUpdateTaskMachineCore】与【GoogleUpdateTaskMachineUA】,把这两个选项禁用。

webdriver.chrome()报错,python,python,chrome,开发语言

如果在【服务和应用程序】——【服务】,也存在Google更新相关的服务【Google更新服务(gupdate)】、【Google更新服务(gupdatem)】,右键——选择属性——启动类型禁用。

 文章来源地址https://www.toymoban.com/news/detail-723705.html

到了这里,关于Python——调用webdriver.Chrome() 报错的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • Python selenium中出现错误:driver = webdriver.chrome() TypeError: ‘module‘ object is not callable

    chrome的首字母应该为大写,如下: driver=webdriver.Chrome() 修改代码后程序即可正常运行 你也可以将路径传递给你的Chromedriver,将executable_path设置为你的chromedriver所在的位置(指向chromedriver.exe的路径,或者,对于非Windows用户,它被称为chromedriver): driver = webdriver.Chrome()是因为没有

    2024年02月12日
    浏览(38)
  • selenium使用 webdriver.Chrome() 报错,找不到执行文件的解决方法(一)

    使用 driver = webdriver.Chrome() 时,遇到以下报错: selenium.common.exceptions.WebDriverException: Message: \\\'chromedriver\\\' executable needs to be in PATH. 两种解决方法: (1)在webdriver.Chrome()中添加executable_path参数,参数value = chromedriver.exe文件所在路径,示例: from selenium import webdriver chrome_driver_path

    2024年02月11日
    浏览(49)
  • python爬虫报错:This version of ChromeDriver only supports Chrome version 114

    使用selenium爬取网页数据,一运行程序就报错: selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 114 Current browser version is 117.0.5938.149 with binary path C:Program FilesGoogleChromeApplicationchrome.exe 就很奇怪,之前都是没问题的

    2024年02月06日
    浏览(38)
  • 使用Python+selenium实例化Microsoft Edge或Chrome浏览器对象和常见的报错

    实例化谷歌浏览器对象: 实例化Microsoft Edge对象: 1.浏览器窗口闪退: 用import time    time.sleep(5),让浏览器多待上一会就好了 2.报错\\\"DeprecationWarning: executable_path has been deprecated\\\":  此错误不耽误程序运行,如果程序因为此错误不能运行,修改代码为: 3.报错\\\"TypeError: \\\'module\\\'

    2024年02月12日
    浏览(35)
  • Python执行selenium报错This version of ChromeDriver only supports Chrome version 114

    Python执行selenium打开浏览器时报错,如下图: This version of ChromeDriver only supports Chrome version 114:此版本的ChromeDriver仅支持Chrome版本114。 查阅资料后发现,selenium目前支持的chrome最高版本为114,但是我的浏览器由于自动更新已经到了116版本。 已经没有支持我浏览器的chromedriver.exe,

    2024年02月09日
    浏览(41)
  • webdriver.Chrome()没反应

    今天学习爬虫安装selenium之后刚开始webdriver.Chrome()正常 后面运行突然卡在这一步了 百度发现是版本不匹配 我们下载旧版本的chrome Download Google Chrome 95.0.4638.69 for Windows - Filehippo.com 禁用chrome的自动更新 打开文件所在位置 点击Google文件夹 右键update属性 全部删除 然后发现打不开

    2024年02月04日
    浏览(27)
  • selenium-webdriver-Chrome新驱动地址(Chrome115及以上版本)

    Chrome115、Chrome116、Chrome117,在旧的链接并没有 新地址:https://googlechromelabs.github.io/chrome-for-testing/

    2024年02月04日
    浏览(40)
  • Python执行selenium报错This version of ChromeDriver only supports Chrome version并配置环境变量

    1.This version of ChromeDriver only supports Chrome version 这个报错的意思是chrome驱动的版本不匹配,所以需要查看自己的chrome的版本,再根据版本下载对应的chromedriver.exe,具体操作步骤如下 第一步查看chrome的版本: 第二步下载对应的chromedriver.exe: http://chromedriver.storage.googleapis.com/ind

    2024年02月16日
    浏览(34)
  • python selenium playwright库使用教程 破解网页防止开发者模式 截取数据请求 隐藏chrome

    下载 chromedriver的版本一定要与Chrome的版本一致,不然就不起作用。 有两个下载地址: 1、 http://chromedriver.storage.googleapis.com/index.html 2、 CNPM Binaries Mirror 当然,你首先需要查看你的Chrome版本,在浏览器中输入chrome://version/  放chromedriver在chrome安装目录  默认目录一般为:C:Pro

    2023年04月25日
    浏览(32)
  • Selenium中WebDriver最新Chrome驱动安装教程

        😏作者简介:博主是一位测试管理者,同时也是一名对外企业兼职讲师。 📡主页地址:【Austin_zhai】 🙆目的与景愿:旨在于能帮助更多的测试行业人员提升软硬技能,分享行业相关最新信息。 💎声明:博主日常工作较为繁忙,文章会不定期更新,各类行业或职场问题

    2024年02月08日
    浏览(45)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包