selenium3.4.2在win7上的安装

来源:互联网 发布:剑三霸刀御姐捏脸数据 编辑:程序博客网 时间:2024/05/22 13:27

平台:win7(64位)  Python3.6.1  selenium3.4.2
前置条件:已安装Python3.6.1
1.打开CMD,输入pip.exe install selenium

2.selenium默认支持Firefox的,3.0版本的selenium调用firefox的时候要用geckodriver.exe,下载这个文件放到Python36\Scripts目录下就行(Python36\Scripts目录在环境变量)。
3.cmd中,输入Python,然后输入from selenium import webdriver ,再输入webdriver.Firefox()
如果可以启动火狐浏览器,说明安装OK

4.如果需要在谷歌浏览器或者IE浏览器中运行,还需要下载chromedriver.exe和IEDriverServer.exe


下载chromedriver.exe :http://chromedriver.storage.googleapis.com/index.html
下载 IEDriverServer.exe  和 selenium server  .jar  :http://selenium-release.storage.googleapis.com/index.html
下载 geckodriver.exe :  https://github.com/mozilla/geckodriver/releases/    火狐用
下载  所有的  driver.exe :https://www.npmjs.com/package/selenium-webdriver
目前, selenium IDE,只有 火狐浏览器插件  , 阿里云 ,也有类似 自动化测试插件的工具。
selenium 官网 IDE 等一系列 下载地址:http://www.seleniumhq.org/download/
阿里云,在线 自动化测试 地址:http://fts.aliyun.com/index.htm


其他的网址:
 selenium 3.0 + 火狐浏览器,启动问题 解决方案 :http://blog.csdn.net/u010969970/article/details/52228689
chromedriver与chrome各版本及下载地址  http://blog.csdn.net/cz9025/article/details/70160273

geckodriver.exe各个版本下载 https://github.com/mozilla/geckodriver/releases/

selenium+python环境搭配:
selenium2+firefox46以下版本(无需驱动包)
selenium3+firefix47以上版本(需geckodriver.exe)


参考文章
使用selenium IDE 等一系列需要下载的东西的地址  http://blog.csdn.net/cz9025/article/details/70160273


笔记:路径中以u开头的,应当在路径前添加r


原创粉丝点击