添加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. ionic3 小记录

    cordova platform add ios@latest 安装最新ios ionic cordova build ios -- --buildFlag="-UseModernBuild ...

  2. linux发展

    硬件 1946年诞生于宾夕法尼亚州,占地170平米,重量达到30吨,名字叫做ENIAC(electronic numerical integrator and calculator)主要作用是为美国国 ...

  3. linux将apache设置为系统服务和开机自启

    1> 查看一下/etc/init.d/下是否存在httpd这个服务 ls /etc/init.d/ | grep httpd 如果没有执行下一步 2>将自己安装目录下的apachect1复 ...

  4. MATLAB 通过对话框返回值选择下一步操作

    学习来源:http://muchong.com/t-10428977-1-pid-1 Userchoice = questdlg(['您确定导入彩色图像?'],'提示','转为灰度图处理','展示彩色 ...

  5. git反悔

    Checkout checkout命令用于从历史提交(或者暂存区域)中拷贝文件到工作目录,也可用于切换分支. ![](./_image/2016-07-14 21-26-37.jpg?r=49) ![ ...

  6. MySql 版本

    MySql 版本: netformwork 2.0 netformwork 4.0

  7. vue的计算属性computed和监听器watch

    <template> <div> this is A.vue <br> <!--计算属性--> <label for="msg" ...

  8. IT题库1-HashMap、HashSet和HashTable(区别?数据格式?)

    1. HashTable和HashMap的区别 HashMap和Hashtable都实现了Map接口.主要区别:线程安全性,同步(synchronization),以及速度. 1.HashMap是非s ...

  9. SQL count(1)

    If you are ever unsure what to put inside a COUNT() aggregation, you can do COUNT(1) to count the ro ...

  10. Atom读写MarkDown插件选择,以及墙内安装markdown-preview-enhanced,及markdown和mermaid使用教程

    1.Atom自带markdown-preview 功能太少,需要大量拓展. 2.markdown-preview-plus 功能还不错,但是其中的滚动条插件markdown-scroll-sync和最 ...