selenium 浏览器路径找不到

上一篇 / 下一篇  2013-05-16 16:08:44 / 个人分类:selenium

1.Failed to start new browser session:java.lang.RuntimeException: Firefox 3 could not be found in the path!
Please add the directory containing ''firefox.exe'' to your PATH environment.
遇到的原因:firefox没有安装在c盘(本人安装在d盘下),selenium找不到firefox路径。
解决过程:首先尝试将firefox.exe的路径放到系统环境变量path中,重新运行,错误依旧。
正确解决办法一:在调用firefox处加上绝对路径(selenium("localhost", 4444, "*firefox D:\\Program Files\\Mozilla Firefox\\firefox.exe", "http://www.baidu.com"))
注意:空格和双斜杠,python脚本下的
正确解决办法二:按方法一解决后,老大嫌我脚本太丑陋,建议重装firefox到c盘,于是重装,问题解决。

TAG:

 

评分:0

我来说两句

日历

« 2024-04-30  
 123456
78910111213
14151617181920
21222324252627
282930    

数据统计

  • 访问量: 7207
  • 日志数: 3
  • 建立时间: 2013-01-07
  • 更新时间: 2013-05-16

RSS订阅

Open Toolbar