执行webdriver.Chrome()时报错:Chromedriver executable needs to be in path。

原因可能是为有安装Chromedriver 可能是Chromedriver版本与Chrome版本不匹配。

步骤1. 下载chromedriver

查看自己的Chrome版本,查看Chromedriver对应表进行下载

这位作者提供的ChromeDriver版本与Chrome版本最新对应关系: https://blog.csdn.net/u011748542/article/details/85078197

下载地址:https://chromedriver.storage.googleapis.com/index.html

步骤2. 将chromedriver.exe复制到Chrome浏览器安装目录

下载zip包之后,发现里面仅有一个chromedriver.exe文件,把文件放到Chrome浏览器安装目录下面。如 C:\Program Files (x86)\Google\Chrome\Application
(查看Chrome安装目录:打开Chrome浏览器,打开任务管理器,右击Chrome.exe,点击属性查看安装位置)
 

步骤3. 将chromedriver.exe复制到python安装目录

步骤4. 将浏览器环境变量添加到系统path中

打开电脑----在电脑桌面上----右击----我的电脑----选择属性

在我的电脑属性中----左侧----点击----高级系统设置

点击----环境变量----在系统变量中找到----path----编辑

OK!在执行下python脚本试试看~

Chromedriver executable needs to be in path 解决办法的更多相关文章

  1. 关于 'chromedriver' executable needs to be in PATH 的解决办法

    用 chrome 浏览器跑 selenium,执行以下脚本: from selenium import webdriverdr=webdriver.Chrome()dr.maximize_window ...

  2. 解决:'chromedriver' executable needs to be in PATH的问题

    0.前言 今天写一个B站登录的模拟器时,用到了Chrome浏览器,但是会报了一个异常"'chromedriver' executable needs to be in PATH", ...

  3. 解决selenium.common.exception.WebDriverException:Message:'chromedriver' executable needs to be in Path

    'chromedriver' executable needs to be in Path 声明:本人萌新,刚学python不久记录一下自己的坑,发出来若能帮助到一些人尽早解决问题那便是极好的,( ̄▽ ...

  4. selenium使用遇到的问题(selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH.)

    1.安装pip3 install selenium 2.使用browser=webdriver.Chrome()时报错 :selenium.common.exceptions.WebDriverExc ...

  5. python+selenium,打开浏览器时报selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH

    有一年多没写web自动化了,今天搭建环境的时候报了一个常见错误,但是处理过程有点闹心,报错就是常见的找不到驱动<selenium.common.exceptions.WebDriverExcep ...

  6. mac-webui-selenium下的webdriver selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH

    from selenium import webdriver def test1(): url='http://www.baidu.com' driver=webdriver.Chrome(" ...

  7. centos7 selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH

    1.查看安装的chrome浏览器版本 2.查看版本对应的驱动 https://sites.google.com/a/chromium.org/chromedriver/downloads 下载后拷贝到 ...

  8. Message: 'geckodriver' executable needs to be in PATH. 解决方法

    问题描述: 执行如下代码 # coding=utf-8 from selenium import webdriver driver = webdriver.Firefox() driver.maxim ...

  9. Go丨语言package github.com/Go-SQL-Driver/MySQL: exec: "git": executable file not found in %PATH%解决方法

    Go语言在添加第三方MySQL驱动的时候报错: go: missing Git command. See https://golang.org/s/gogetcmd package github.co ...

随机推荐

  1. java第三次上机

    import java.util.*; class student{ String name; char sex; int age; String number; double score[]=new ...

  2. linux windows 格式化一块大于2 TiB硬盘

    转自:https://help.aliyun.com/document_detail/34377.html?spm=a2c4g.11186623.2.10.17447386JrLBNR#concept ...

  3. sql 中 and 和 or的坑

    请参考以下链接 https://blog.csdn.net/u011064736/article/details/70257366

  4. Java包装类介绍与类型之间相互转换

    1.包装类存在的意义 通俗解释就是由于Java是面对对象的语言,而基本类型不具有面对对象的概念,为了弥补不足,引入了包装类方便使用面对对象的变成思想操作基本类型. 2.基本类型和包装类对应关系 byt ...

  5. Gridview标题头添加排序图片

    向gridview标题头中添加排序图片,当点击某一个头标题时,在标题中出现升序箭头向上的图片,再点击一次时降序,在标题中出现箭头向下的图片,初始页面时在标题头中并不现实任何图片. 先定义好一个grid ...

  6. 解决 Cannot uninstall 'pyparsing' 问题

    参考 pyparsing 无法卸载导致安装 matplotlib 出错 解决 Cannot uninstall 'pyparsing' 问题 在安装 pydot 时遇到依赖 pyparsing 无法更 ...

  7. 详解Python的装饰器

    Python中的装饰器是你进入Python大门的一道坎,不管你跨不跨过去它都在那里. 为什么需要装饰器 我们假设你的程序实现了say_hello()和say_goodbye()两个函数. def sa ...

  8. 举例理解JDK动态代理

    JDK动态代理 说到java自带的动态代理api,肯定离不开反射.JDK的Proxy类实现动态代理最核心的方法: public static Object newProxyInstance(Class ...

  9. http压测工具wrk使用

    安装 wrk支持大多数类UNIX系统,不支持windows.需要操作系统支持LuaJIT和OpenSSL,不过不用担心,大多数类Unix系统都支持.安装wrk非常简单,只要从github上下载wrk源 ...

  10. vue文档阅读笔记——计算属性和侦听器

    页面链接:https://cn.vuejs.org/v2/guide/computed.html 注意点 计算属性用于 替代模板内的表达式. 如果计算属性所依赖的属性未更新,会返回自身的缓存. 侦听器 ...