python使用selenium

'chromedriver' executable needs to be in PATH.
在python下引用selenium包开发的时候,测试webdriver功能的时候就出现了这样的错误,此错误说明chromedriver需要path
我开始到顺利使用selenium顺序如下
1.在python中使用 pip install selenium (如果出现403,则是网的错误,多重复几遍)
2.下载chromedriver
http://code.google.com/p/chromedriver/downloads/list
3.解压chromedriver,并将chromedriver.exe直接复制到python的Scripts目录下,
4.输入以下代码
from selenium import webdriver
browser = webdriver.Chrome()
browser.get('http://www.baidu.com/')
5.即可用chrome访问百度
6.如果要看其他浏览器的selenium用法驱动器,访问
http://www.seleniumhq.org/about/platforms.jsp#browsers

posted @ 2017-08-06 17:51  子不语怪力乱神  阅读(172)  评论(0编辑  收藏  举报