chromedriver和firefox driver的安装过程


环境:ubuntu14.04, python2.7 selenium2.0

文章参考出处:http://blog.csdn.net/heybob/article/details/52922645

chromedriver(Chrome浏览器):我的谷歌浏览器版本 62.0.3202.89下载的驱动为V2.31

http://chromedriver.storage.googleapis.com/index.html

geckodriver(Firefox浏览器)我的火狐浏览器版本Firefox 57.0下载的驱动为V0.190

https://github.com/mozilla/geckodriver/releases

1.查看谷歌浏览器的版本:chromium-browser -version

1.1查看firefox的版本:firefox -v

2.将chromedriver下载解压然后放到/usr/bin,然后加上执行权限,命令如下:

$ unzip chromedriver_linux64.zip

$ sudo mv chromedriver /usr/bin/

cd /usr/bin/

sudo chmod a+x chromedriver

2,测试 

[python]  view plain  copy
  1. from selenium import webdriver  
  2.   
  3. driver = webdriver.Chrome()  
  4. # driver = webdriver.Firefox()  
  5. driver.get('http://www.baidu.com')  
  6. print driver.title  
  7. driver.quit()  

4,后记

再次执行测试代码成功,说明selenium基本安装成功了。另一个geckodriver也是一样

 

找了半天安装selenium的博客,但是没看到几个ubuntu下关于driver的具体安装的,所以我这里记录下。

python IDLE端测试结果如下:

Python 2.7.6 (default, Oct 26 2016, 20:30:19) 

[GCC 4.8.4] on linux2

Type "copyright", "credits" or "license()" for more information.

>>> ================================ RESTART ================================

>>> 

百度一下,你就知道

>>> 

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM