selenium 报错 DeprecationWarning: executable_path has been deprecated, please pass in a Service object

这篇具有很好参考价值的文章主要介绍了selenium 报错 DeprecationWarning: executable_path has been deprecated, please pass in a Service object。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

deprecationwarning什么错误,UI自动化,selenium,ar,测试工具

DeprecationWarning: executable_path has been deprecated, please pass in a Service object
  driver = webdriver.Chrome(executable_path='chromedriver.exe')

出现 DeprecationWarning 警告的类型错误:该类型的警告大多属于版本已经更新,所使用的方法过时。

查询当前版本重构后的函数,是之前的 executable_path 被重构到了 Service 函数里
deprecationwarning什么错误,UI自动化,selenium,ar,测试工具

尝试解决方法:文章来源地址https://www.toymoban.com/news/detail-568376.html

from selenium import webdriver
from selenium.webdriver.chrome.service import Service

# 尝试传参
s = Service("chromedriver.exe")
driver = webdriver.Chrome(service=s)


driver.get('https://www.baidu.com/')
driver.quit() 

到了这里,关于selenium 报错 DeprecationWarning: executable_path has been deprecated, please pass in a Service object的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

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

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

相关文章

  • 【Error】DeprecationWarning: executable_path has been deprecated, please pass in a Service object

    解决warning: DeprecationWarning: executable_path has been deprecated, please pass in a Service object driver = webdriver.Edge(\\\'C:/Users/cong/AppData/Local/Programs/Python/Python310/msedgedriver.exe\\\',options=option) 这个警告信息是在使用Python的Selenium库时出现的。它提示说“executable_path”已经被弃用了,建议使用一个Serv

    2024年02月06日
    浏览(34)
  • webdriver报错:TypeError: __init__() got an unexpected keyword argument ‘executable_path‘已解决

    webdriver报错:TypeError: init () got an unexpected keyword argument \\\'executable_path’已解决 错误段代码如下: 先说一下我下载的chromedriver版本是122.0.6261.94,chrome的版本是122.0.6261.112 selenium或selenium下的webdriver的库版本的原因,与chromedriver的版本不匹配。 终端执行pip show selenium查看版本。我报

    2024年04月25日
    浏览(32)
  • 解决python出现的Executable executable_path has been deprecated问题

    1、错误脚本: 错误结果: 2、错误原因 出现 DeprecationWarning 警告的类型错误: 该类型的警告大多属于版本更新时,所使用的方法过时的原因;某方法在当前版本被重构,依旧可以传入参数,但是在之后的某个版本会被删除。 3、解决方案  正确结果:  

    2024年02月16日
    浏览(27)
  • TypeError:__init__() got an unexpected keyword argunent ‘executable_path‘解决方案

      大家好,我是爱编程的喵喵。双985硕士毕业,现担任全栈工程师一职,热衷于将数据思维应用到工作与生活中。从事机器学习以及相关的前后端开发工作。曾在阿里云、科大讯飞、CCF等比赛获得多次Top名次。现为CSDN博客专家、人工智能领域优质创作者。   本文主要介

    2024年02月11日
    浏览(50)
  • 解决selenium操作Chrome浏览器报错:WebDriverException: Message: ‘chromedriver‘ executable needs to be in PATH

    在使用selenium操作Chrome浏览器报错:selenium. common.exceptions . WebDriverException: Message: ‘chromedriver’ executable needs to be in PATH 截图如下: 主要报错信息内容翻译如下所示: selenium. common.exceptions . WebDriverException: Message: ‘chromedriver’ executable needs to be in PATH 翻译: selenium. common.except

    2024年02月04日
    浏览(37)
  • selenium的Edge驱动安装后,仍出现‘MicrosoftWebDriver.exe‘ executable needs to be in PATH.

    首先已经在edge的网站 https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ 中下载了符合浏览器版本的edge驱动器 我们可以看到解压后的驱动器的文件名为msedgedriver.exe 运行该程序后出现一下错误 (1)直接修改驱动器名称 由于驱动器本身是官网下载,而为Microsoft Edge WebDrive

    2024年02月13日
    浏览(27)
  • 报错 unable to find valid certification path to requested target executing

    提示信息: 审核失败!sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target executing POST 。。。 。。。 出现原因 这个问题的根本原因是你安装JDK时,Javajar 1.8.0_141libext里面缺少了一

    2024年02月03日
    浏览(34)
  • Java selenium使用出现The path to the driver executable must be set by the webdriver.edge.driver system

    2023年3月份Java selenium开始使用出现The path to the driver executable must be set by the webdriver.edge.driver system property; for more; 尝试更换chrome driver,以及根据网上的使用白名单来解决都不生效, 后续发现需要更新Java selenium的使用方式: 以Windows为例需要在之前配置上加上: 1、为driver设置

    2024年01月22日
    浏览(33)
  • 已解决(selenium报错)AttributeError: ‘WebDriver‘ object has no attribute ‘execute_cdp_cmd‘

    已解决(selenium报错)AttributeError: ‘WebDriver‘ object has no attribute ‘execute_cdp_cmd‘ 粉丝群里面一个小伙伴运行selenium 操作Chrome浏览器的时候报错(当时他心里瞬间凉了一大截,跑来找我求助,然后顺利帮助他解决了,顺便记录一下希望可以帮助到更多遇到这个bug不会解决的小

    2024年02月09日
    浏览(50)
  • 使用pycharm配置出现Conda executable path is empty问题

    Conda executable path is empty 在pycharm中配置使用Conda Environment出现Conda executable path is empty报错 报错为conda可执行路径为空,可能原因有三,可以一次排除 是否安装并能使用anaconda Conda executable的位置错误 Interpreter(python翻译器)位置错误 如果是原因一,则先安装配置好anaconda 原因二

    2024年02月13日
    浏览(36)

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

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

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

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

二维码1

领取红包

二维码2

领红包