添加Chrome浏览器程序的目录到系统Path变量中:

C:\Users\%USERNAME%\AppData\Local\Google\Chrome\Application ,使用pip3 install selenium安装selenium模块后,在jupyter notebook中运行示例程序:

from selenium import webdriver

browser = webdriver.Chrome()

browser.get('http://www.baidu.cn')

【报错信息】:

FileNotFoundError                         Traceback (most recent call last)

c:\users\catty\appdata\local\programs\python\python37\lib\site-packages\selenium\webdriver\common\service.py in start(self)

75                                             stderr=self.log_file,

---> 76                                             stdin=PIPE)

77         except TypeError:

FileNotFoundError: [WinError 2] 系统找不到指定的文件。
During handling of the above exception, another exception occurred:
WebDriverException                        Traceback (most recent call last)
<ipython-input-1-9c76fc9a65d6> in <module>
      1 from selenium import webdriver
      2 
----> 3browser = webdriver.Chrome()
      4 browser.get('http://www.baidu.cn')
      5 
WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home

【解决办法】:

到网址:http://npm.taobao.org/mirrors/chromedriver/

下载与浏览器程序Chrome.exe相对应的版本的chromedriver.exe 程序,放到系统能够找到的路径中,比如:C:\Users\catty\AppData\Local\Programs\Python\Python37目录下,再次在jupyter notebook中运行示例,不再报错,能够正常使用谷歌Chrome浏览器打开百度网站。

参考链接:

python Selenium2.0模块使用中报错的解决办法

https://blog.csdn.net/limeilian10221017/article/details/70570056

chromedriver.exe下载

https://blog.csdn.net/morling05/article/details/81094151

Chromedriver.exe 下载地址

http://npm.taobao.org/mirrors/chromedriver/73.0.3683.68/

http://npm.taobao.org/mirrors/chromedriver/

Mirror index of http://chromedriver.storage.googleapis.com/

使用Selenium模块报错的解决办法 (FileNotFound,WebDriverException)的更多相关文章

  1. Springboot数据库连接池报错的解决办法

    Springboot数据库连接池报错的解决办法 这个异常通常在Linux服务器上会发生,原因是Linux系统会主动断开一个长时间没有通信的连接 那么我们的问题就是:数据库连接池长时间处于间歇状态,导致 ...

  2. Loadrunner参数化连接oracle、mysql数据源报错及解决办法

    Loadrunner参数化连接oracle.mysql数据源报错及解决办法 (本人系统是Win7 64,  两位小伙伴因为是默认安装lr,安装在 最终参数化的时候,出现连接字符串无法自动加载出来: 最 ...

  3. PHP empty函数报错的解决办法

    PHP empty函数在检测一个非变量情况下报错的解决办法. PHP开发时,当你使用empty检查一个函数返回的结果时会报错:Fatal error: Can't use function retur ...

  4. eclipse中的js文件报错的解决办法

    在使用别人的项目的时候,导入到eclipse中发现js文件报错,解决办法是关闭eclipse的js校验功能. 三个步骤: 1. 右键点击项目->properties->Validation ...

  5. Base64 报错 的解决办法 (Base-64 字符数组或字符串的长度无效。, 输入的不是有效的 Base-64 字符串,因为它包含非 Base-64 字符、两个以上的填充字符,或者填充字符间包含非法字符。)

    Base64 报错 的解决办法, 报错如下:1. FormatException: The input is not a valid Base-64 string as it contains a n ...

  6. VM装mac10.9教程+报错信息解决办法

    VM装mac10.9教程+报错信息解决办法 教程1: 教你在Vmware 10下安装苹果Mac10.9系统 地址:http://tieba.baidu.com/p/2847457021 教程2: VM ...

  7. Oracle数据库误删文件导致rman备份报错RMAN-06169解决办法

    Oracle数据库误删文件导致rman备份报错RMAN-06169解决办法 可能是误删文件导致在使用rman备份时候出现以下提示 RMAN-06169: could not read file hea ...

  8. Xamarin开发安装Visual Studio 2015 update2报错的解决办法

    Xamarin开发安装Visual Studio 2015 update2报错的解决办法错误信息:update 2 requires a member of the visual studio 201 ...

  9. Linux虚拟机--进入MySQL报错的解决办法

    在Linux安装MySQL有时候会出现 [mysql]ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/ ...

随机推荐

  1. 2019.04.23 Scrapy框架

    1.环境搭建 2.选择需要的.whl文件下载,一般选择最后的,感觉意思是最近更新的包,以下是.whl文件下载链接地址: http://www.lfd.uci.edu/~gohlke/pythonlib ...

  2. Linux命令行基础

    常用命令 命令 功能 pwd 打开当前所在的文件目录 ls 查看当前文件夹下的文件(不包括隐藏文件) ls -a 查看当前文件夹下的文件(包括隐藏文件) ls -al 查看当前文件夹下的文件(包括隐藏 ...

  3. app ios info权限配置:

    info权限配置: Privacy - Bluetooth Peripheral Usage Description --> App需要您的同意,才能访问蓝牙 Privacy - Calenda ...

  4. 一分钟学会Xmind

  5. CSS其它特性

    文本内容左右对齐及盒子自身左右对齐 说白了,浮动就是可以让我们的div在一行中显示,方便布局,并且各个div之间没有空隙,如果使用display:inline-block也能在一行显示几个div,但是 ...

  6. 论文阅读(XiangBai——【CVPR2017】Detecting Oriented Text in Natural Images by Linking Segments)

    XiangBai——[CVPR2017]Detecting Oriented Text in Natural Images by link Segments 目录 作者和相关链接 方法概括 方法细节 ...

  7. http协议中的响应代码从 1xx ~ 5xx,一共有41种

    http协议中的响应代码从 1xx ~ 5xx,一共有41种 http://how2j.cn/k/http/http-response-code/572.html

  8. VDSR

    提出SRCNN问题 context未充分利用 Convergence 慢 Scale Factor 训练指定fator的模型再重新训练其他fator的模型低效 context 对于更大的scale-f ...

  9. appium工作原理

    Appium原理 面试的时候,被问到appium原理,一点不会,实在尴尬.大家可以直接翻看原作https://blog.csdn.net/jffhy2017/article/details/69220 ...

  10. GridView设置焦点到Cell

    /// <summary> /// 设置焦点到Cell /// </summary> /// <param name="view"></p ...