网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

使用Selenium模块报错的解决办法FileNotFound,WebDriverException

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

我们注重客户提出的每个要求,我们充分考虑每一个细节,我们积极的做好成都网站建设、成都网站设计服务,我们努力开拓更好的视野,通过不懈的努力,创新互联建站赢得了业内的良好声誉,这一切,也不断的激励着我们更好的服务客户。 主要业务:网站建设,网站制作,网站设计,微信小程序,网站开发,技术开发实力,DIV+CSS,PHP及ASP,ASP.Net,SQL数据库的技术开发工程师。

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')

 

【报错信息】:

使用Selenium模块报错的解决办法FileNotFound,WebDriverException

使用Selenium模块报错的解决办法FileNotFound,WebDriverException

FileNotFoundError                         Traceback (most recent call last)

c:\users\catty\appdata\local\programs\python\python37\lib\site-packages\selenium\webdriver\common\service.py instart(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)
 in 
      1 from selenium import webdriver
      2
----> 3 browser = 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
分享URL:http://bjjierui.cn/article/gogjhj.html

其他资讯