首页 > 编程语言 > 详细

python+selenium 环境配置

时间:2017-03-12 15:19:22      阅读:153      评论:0      收藏:0      [点我收藏+]

配置环境:

python:3.5

 

selenium:3.3.0 

安装方式:python pip install -u selenium

技术分享

 

windows: 10

 

firefox:52

因为firefox版本较高,所以需要专门的driver来驱动,需要下载geckodriver

百度网盘地址:http://pan.baidu.com/s/1dEBbkwp

放置位置

  • Windows: python安装根目录(与python.exe 同一目录)
  • Mac: /user/local/bin

测试代码:

from selenium import webdriver

driver = webdriver.Firefox()
driver.get("http://www.baidu.com")

driver.find_element_by_id("kw").send_keys("Selenium2")
driver.find_element_by_id("su").click()

driver.quit()

我这边是完美运行:

技术分享

 

python+selenium 环境配置

原文:http://www.cnblogs.com/lza945/p/6537629.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!