selenium下启动Firefox配置

上一篇 / 下一篇  2016-11-02 15:18:41 / 个人分类:Python

Traceback(most recent call last):File"C:\Users\LENOVO\Desktop\kk2.py",line4,in<module>driver=webdriver.Firefox()File"C:\Python27\lib\site-packages\selenium\webdriver\firefox\webdriver.py",line135,in__init__
  self.service.start()File"C:\Python27\lib\site-packages\selenium\webdriver\common\service.py",line71,instart
  os.path.basename(self.path),self.start_error_message)WebDriverException:Message:'geckodriver'executable needs to beinPATH.
如何chrome和IE浏览器,在selenium 3.0以上版本在启动Firefox时,需要下载geckodriver插件。下载地址如下:https://github.com/mozilla/geckodriver/releases

1.下载相应版本的geckdriver.exe,放在C:\python27
2.将Firefox浏览器的路径(C:\Program Files (x86)\Mozilla Firefox)添加在Path下
3.重启浏览器执行即可


TAG: firefox Firefox

 

评分:0

我来说两句

我的栏目

日历

« 2024-05-01  
   1234
567891011
12131415161718
19202122232425
262728293031 

数据统计

  • 访问量: 30867
  • 日志数: 12
  • 建立时间: 2015-10-29
  • 更新时间: 2017-04-20

RSS订阅

Open Toolbar