Python- Anacoda环境使用Selenium+ChromeDriver报错
我的系统是win10,python是用Anacoda安装的,通过pip安装了selenium 后使用Chromedriver发现报错,pip安装selenium如下:
pip install selenium
报错具体如下:
driver=webdriver.Chrome()
Traceback (most recent call last):
File "D:\app\Anaconda\lib\site-packages\selenium\webdriver\common\service.py", line , in start
stdin=PIPE)
File "D:\app\Anaconda\lib\subprocess.py", line , in __init__
restore_signals, start_new_session)
File "D:\app\Anaconda\lib\subprocess.py", line , in _execute_child
startupinfo)
FileNotFoundError: [WinError ] 系统找不到指定的文件。 During handling of the above exception, another exception occurred: Traceback (most recent call last):
File "<stdin>", line , in <module>
File "D:\app\Anaconda\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line , in __init__
self.service.start()
File "D:\app\Anaconda\lib\site-packages\selenium\webdriver\common\service.py", line , in start
os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home
selenium操作chrome浏览器需要有ChromeDriver驱动来协助。
解决办法:
1.下载Chromedriver,网盘:https://pan.baidu.com/s/1c3KLRJa
2.把Chromedriver解压到D:\app\Anaconda\Scripts\下,重新运行命令即可打开Chromedriver

在运行了
driver=webdriver.Chrome()
driver.get('www.baidu.com')
之后出现报错:
>>> driver.get('m.weibo.com')
Traceback (most recent call last):
File "<stdin>", line , in <module>
File "D:\app\Anaconda\lib\site-packages\selenium\webdriver\remote\webdriver.py", line , in get
self.execute(Command.GET, {'url': url})
File "D:\app\Anaconda\lib\site-packages\selenium\webdriver\remote\webdriver.py", line , in execute
self.error_handler.check_response(response)
File "D:\app\Anaconda\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line , in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: chrome not reachable
(Session info: chrome=63.0.3239.132)
(Driver info: chromedriver=2.31. (092de99f48a300323ecf8c2a4e2e7cab51de5ba8),platform=Windows NT 10.0. x86_64)
原因是打开的域名一定要加前http://,改正后如下:

Python- Anacoda环境使用Selenium+ChromeDriver报错的更多相关文章
- python中引入包的时候报错AttributeError: module 'sys' has no attribute 'setdefaultencoding'解决方法?
python中引入包的时候报错:import unittestimport smtplibimport timeimport osimport sysimp.reload(sys)sys.setdef ...
- selenium启动报错“ incorrect JSON status mapping for 'unknown error' (500 expected)”
前面讲了工程启动报错“selenium启动报错Unable to read VR Path Registry from C:\Users\clinva\AppData\Local\openvr\ope ...
- selenium+phantomjs报错:Unable to find a free port的分析和解决
selenium+phantomjs报错:Unable to find a free port的分析和解决 Table of Contents 1. 现象 2. 分析 3. 解决办法 1 现象 在做项 ...
- vuejs npm chromedriver 报错
vuejs npm chromedriver 报错 # 全局安装 vue-cli$ npm install -g vue-cli# 创建一个基于 "webpack" 模板的新项 ...
- 记一次用python 的ConfigParser读取配置文件编码报错
记一次用python 的ConfigParser读取配置文件编码报错 ...... raise MissingSectionHeaderError(fpname, lineno, line)Confi ...
- python+selenium运行报错UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128)
使用python+selenium运行自动化脚本时,打印某一段文字出现UnicodeEncodeError: 'ascii' codec can't encode characters in posi ...
- python selenium phantomjs 报错
报错: webdriver.PhantomJS() raise exception_class(value)selenium.common.exceptions.WebDriverException: ...
- selenium+python自动化85-python3.6上SendKeys报错用PyUserInput取代
前言 python2上安装SendKeys库,对于不好定位的元素,用快捷键操作是极好的,那么在3.6上安装时,会报错 python3.6安装SendKeys报错 1.python3.6安装SendKe ...
- 使用Selenium模块报错的解决办法 (FileNotFound,WebDriverException)
添加Chrome浏览器程序的目录到系统Path变量中: C:\Users\%USERNAME%\AppData\Local\Google\Chrome\Application ,使用pip3 inst ...
随机推荐
- Webpack与Gulp、Grunt区别
Webpack与Gulp.Grunt没有什么可比性,它可以看作模块打包机,通过分析你的项目结构,找到JavaScript模块以及其它的一些浏览器不能直接运行的拓展语言(Scss,TypeScript等 ...
- dede 文章列表页如何倒序排列
{dede:arclist row='6' typeid='18' orderway='asc'} <li>;<a href="[field:arcurl/]"& ...
- 07 在Windows下编译Memcached
一:windows下编译Memcached (1)下载地址dll:http://down.51cto.com/data/442606 (2)在php下输出 echo phpinfo():查看php的版 ...
- Python读取word文档(python-docx包)
最近想统计word文档中的一些信息,人工统计的话...三天三夜吧 python 不愧是万能语言,发现有一个包叫做 docx,非常好用,具体查看官方文档:https://python-docx.read ...
- getMeasuredHeight(),getScrollY(),getHeight()的区别和联系
前言:关于控件的高度有两种获取方式,一个是获得控件的实际大小(getMeasuredHeight),就是包含显示部分和已显示的部分: 而getHeight是获得控件的显示的大小,如果控件大小超出的屏幕 ...
- vuforia 中摄像机的开启与关闭
本文主要讲解的是Unity对Vuforia的开发中在原生调用摄像头上遇到的坑~Unity中调用设备摄像头打开或则关闭,或则开关扫描识别问题等等一些情况~ 下面先说说趟过的坑,再说说解决办法,或则目前没 ...
- C语言基础知识【简介】
C 简介1.关于 CC 语言是为了编写 UNIX 操作系统而被发明的.C 语言是以 B 语言为基础的,B 语言大概是在 1970 年被引进的.C 语言标准是于 1988 年由美国国家标准协会(ANSI ...
- Git客户端搭建环境(Windows系统)的使用
本文环境: 操作系统:Windows XP SP3 Git客户端:TortoiseGit-1.8.8.0-32bit 一.安装Git客户端 全部安装均采用默认! 1. 安装支撑软件 msysgit: ...
- poj3708(公式化简+大数进制装换+线性同余方程组)
刚看到这个题目,有点被吓到,毕竟自己这么弱. 分析了很久,然后发现m,k都可以唯一的用d进制表示.也就是用一个ai,和很多个bi唯一构成. 这点就是解题的关键了. 之后可以发现每次调用函数f(x),相 ...
- 【BZOJ4004】[JLOI2015]装备购买 贪心+高斯消元
[BZOJ4004][JLOI2015]装备购买 Description 脸哥最近在玩一款神奇的游戏,这个游戏里有 n 件装备,每件装备有 m 个属性,用向量zi(aj ,.....,am) 表示 ( ...