WebDriverException: Message: 'phantomjs.exe' executable needs to be in PATH.
本文转载自:http://blog.csdn.net/sinat_36764186/article/details/55520444
网上的某测试代码:
from selenium import webdriver
driver = webdriver.PhantomJS(executable_path="C:\Python27\Scripts\phantomjs-2.1.1-windows\bin\phantomjs.exe")
driver.get("http://www.baidu.com")
data = driver.title
print data
配置环境变量path
C:\Python27\Scripts\phantomjs-2.1.1-windows\bin
无效(此处发现有人的错误是路径一直写到了xxx.exe)
检查源程序
发现自己原来把Scripts打成了Script
路径请复制不要手打!
仍有错
最终
Windows环境下完整路径前加r!!!
即
executable_path=r"C:\Python27\Scripts\phantomjs-2.1.1-windows\bin\phantomjs.exe"
解决
WebDriverException: Message: 'phantomjs.exe' executable needs to be in PATH.的更多相关文章
- 'phantomjs.exe' executable needs to be in PATH. (selenium PhantomJS python)
今天selenium PhantomJS python用了下,发现报错,提示我:'phantomjs.exe' executable needs to be in PATH. from seleniu ...
- selenium.common.exceptions.WebDriverException: Message: 'phantomjs' executab
该问题博主是在Mac环境遇到的,对应windows找对应解决方案解决即可. 问题原因: phantomjs环境配置有问题,要么是配置错误,要么是没有配置. 解决方案: 1.将下载解压好的phantom ...
- Python ——selenium报错 'chromedriver.exe' executable needs to be in PATH
from selenium import webdriver dr = webdriver.Chrome() 运行时报错: 问题分析: 1.没有下载chromedriver.exe 2.chromed ...
- 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 下载后拷贝到 ...
- 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 ...
- windows下使用selenium报错selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH
问题 :执行程序代码报错: WebDriverException:Message:'geckodriver'executable needs to be in Path 或者 selenium.com ...
- selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH. 错误处理方法
首次使用selenium webdriver,webdriver.Firefox() 报错selenium.common.exceptions.WebDriverException: Message: ...
- selenium使用报错“selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.”
安装了python3,使用pip安装了selenium,但是在使用时,报了“selenium.common.exceptions.WebDriverException: Message: 'gecko ...
- Selenium安装失败WebDriverException: Message: 'gechodriver' executable needs to be in PATH
在搭建Python+Selenium自动化测试时,用python通过WebDriver驱动Firefox浏览器时,一直无法执行测试用例. 报错信息:WebDriverException: Messag ...
随机推荐
- AngularJs 控制台
在控制台查看$scope对象 html: 通过控制器里面的一个元素来获取这个控制器的$scope var node=document.getElementById("NewsVote&quo ...
- luogu p3366 最小生成树模板
倒腾了一个小时 自己也没去看网上的 总算自己能写出来模板了 kruskal //最小生成树 每次找最短的边 #include<bits/stdc++.h> using namespace ...
- MyBatis获取SqlSession
package com.ykmimi.dao; import org.apache.ibatis.session.SqlSession; import com.ykmimi.entity.Studen ...
- SDN原理 OpenFlow协议 -3
问题4:流表匹配 OF1.1版本 这是OF1.1版本的操作,引入了多流表,1.0版本并没有多流表. 多流表的匹配称为 流水线处理:交换机从流表0开始查找,按照流表序号从小到大匹配. 每个包按照优先级去 ...
- 前端工程化 - Yeoman
什么是Yeoman Yeoman是一个前端构建工具.它整合了yo(yeoman).gulp/grunt和npm/bower等工具,组成了一个完整的工具集合,为前端开发提供了一套完整的解决方案. Yeo ...
- photoswipe图片滑动插件使用
第一步: 引入jss和css文件 <!-- Core CSS file --> <link rel="stylesheet" href="path/t ...
- 使用quartz实现定时器功能
首先导入两个包 <dependency> <groupId>org.quartz-scheduler</groupId> <artifactId>qua ...
- SpringBoot创建多模块方式以及打包方式
springboot重构多模块的步骤 模型层:model 持久层:persistence 表示层:web 步骤: 正常创建一个springboot项目 修改创建项目的pom文件,将jar修改为pom ...
- ACM比赛学习指导(20180223)
0.比赛介绍 (1)浙江省大学生程序设计比赛,3人一组,题目为英文 (2)ACM程序设计比赛 百度百科介绍 1.理论学习 (1)<挑战程序设计竞赛>,秋叶拓哉,巫泽俊 (2)<算法竞 ...
- 如果从excel表中导出insert-sql
=CONCATENATE("INSERT INTO p_act_lottery(actId,status,grantWay,createTime,invalidTime,amount,pri ...