'phantomjs.exe' executable needs to be in PATH. (selenium PhantomJS python)
今天selenium PhantomJS python用了下,发现报错,提示我:'phantomjs.exe' executable needs to be in PATH.
from selenium import webdriver# Open PhantomJS
driver = webdriver.PhantomJS(executable_path='C:\phantomjs-2.1.1-windows\bin\phantomjs.exe')
这样运行报错,我百度了下,发现解决方式,在完整路径前面加了一个r 就行了
driver = webdriver.PhantomJS(executable_path=r'C:\phantomjs-2.1.1-windows\bin\phantomjs.exe')
# coding=utf-8
from selenium import webdriver
# Open PhantomJS
driver = webdriver.PhantomJS(executable_path=r'C:\phantomjs-2.1.1-windows\bin\phantomjs.exe')
driver.get("http://www.qq.com")
title = driver.title
driver.save_screenshot('qq.png')
print title #腾讯首页

'phantomjs.exe' executable needs to be in PATH. (selenium PhantomJS python)的更多相关文章
- WebDriverException: Message: 'phantomjs.exe' executable needs to be in PATH.
本文转载自:http://blog.csdn.net/sinat_36764186/article/details/55520444 网上的某测试代码: from selenium import we ...
- Python ——selenium报错 'chromedriver.exe' executable needs to be in PATH
from selenium import webdriver dr = webdriver.Chrome() 运行时报错: 问题分析: 1.没有下载chromedriver.exe 2.chromed ...
- python+selenium自动化软件测试(第6章):selenium phantomjs页面解析使用
我们都知道Selenium是一个Web的自动化测试工具,可以在多平台下操作多种浏览器进行各种动作,比如运行浏览器,访问页面,点击按钮,提交表单,浏览器窗口调整,鼠标右键和拖放动作,下拉框和对话框处理等 ...
- selenium+phantomjs渲染网页
from selenium import webdriverfrom selenium.webdriver.common.desired_capabilities import DesiredCapa ...
- 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 下载后拷贝到 ...
- VSCode调试go语言出现:exec: "gcc": executable file not found in %PATH%
1.问题描述 由于安装VS15 Preview 5,搞的系统由重新安装一次:在用vscdoe编译go语言时,出现以下问题: # odbcexec: "gcc": executabl ...
- 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 ...
- Chromedriver executable needs to be in path 解决办法
执行webdriver.Chrome()时报错:Chromedriver executable needs to be in path. 原因可能是为有安装Chromedriver 可能是Chrome ...
- Message: 'geckodriver' executable needs to be in PATH. 解决方法
问题描述: 执行如下代码 # coding=utf-8 from selenium import webdriver driver = webdriver.Firefox() driver.maxim ...
随机推荐
- Linux入门进阶第五天——用户管理(帐号管理 )上
一.帐号与群组 关于使用者帐号: 用户的ID与帐号信息所在位置是 /etc/passwd,而管理密码的数据则是在 /etc/shadow 每个登陆的使用者至少都会取得两个 ID , 一个是使用者 ID ...
- 20155333 2016-2017-2 《Java程序设计》第4周学习总结
20155333 2016-2017-2 <Java程序设计>第4周学习总结 教材学习内容总结 继承基本上就是避免多个类间重复定义的共同行为,在Java中,子类只能继承一个父类. priv ...
- hive bug
SHELL$ hive -S -e “set” | grep warehouse hive.metastore.warehouse.dir=/user/hive/warehouse hive.ware ...
- SpringBoot (1) idea下的环境搭建及demo
1.Spring Boot简介 wiki上的介绍: Spring Boot是Spring的常规配置解决方案,用于创建可以“运行”的独立的,生产级的基于Spring的应用程序.[22]它预先配置了Spr ...
- Mac下布置appium环境
1.下载或者更新Homebrew:homebrew官网 macOS 不可或缺的套件管理器 $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githu ...
- Google Chrome插件分享
前言 浏览器是大家日常使用最多的工具之一,对于程序员来说,Google Chrome浏览器当然是大家优选的最爱之一.面对Chrome丰富的插件真的是爱不释手,如何把自己的Chrome调教成自己心仪的样 ...
- 十大经典排序算法总结 (Python)
作业部落:https://www.zybuluo.com/listenviolet/note/1399285 以上链接是自己在作业部落编辑的排序算法总结- Github: https://github ...
- Wampserver 修改根目录
wampserver 默认根目录在 www 文件夹下 修改根目录方法如下: 1. 在打算存放项目或代码的位置新建文件夹(我建在了C:/MyProject) 2. 打开 httpd.conf 文件(该文 ...
- Kickstart 安装centos7
以前是怎么安装系统的 光盘(ISO文件,光盘的镜像文件)===>每一台物理机都得给一个光驱,如果用外置光驱的话,是不是每台机器都需要插一下 U盘:ISO镜像刻录到U盘==>需要每台机器都需 ...
- ES6的新特性(19)——Module 的语法
Module 的语法 概述 历史上,JavaScript 一直没有模块(module)体系,无法将一个大程序拆分成互相依赖的小文件,再用简单的方法拼装起来.其他语言都有这项功能,比如 Ruby 的re ...