selenium+python环境搭建

Posted 一直前行

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了selenium+python环境搭建相关的知识,希望对你有一定的参考价值。

1、JAVA环境,配置相应环境变量。

查看是否配置成功如下:

2、python环境,配置相应环境变量。包括python和Python/Scripts两个路径

查看是否配置成功如下:

3、安装selenium

  通过pip安装,python路径下输入:py -2 -m pip install selenium安装

4、下载浏览器,且需要安装相应webdriver

  如下载火狐浏览器  http://www.firefox.com.cn/,需下载gectkodriver   https://github.com/mozilla/geckodriver/releases/

  如下载谷歌浏览器 ,相应webdriver下载路径为 http://npm.taobao.org/mirrors/chromedriver

  如下载IE浏览器,相应为 http://selenium-release.storage.googleapis.com/index.html

5、安装编辑器,如PyCharm

 

安装完成后,可以验证,浏览器可以被打开且进入相应界面(特别注意的就是,浏览器需要安装webdriver,我就在这折腾了半天):  

 

 

以上是关于selenium+python环境搭建的主要内容,如果未能解决你的问题,请参考以下文章

selenium环境配置

Web功能测试练习

环境搭建---1.1---python+selenium环境搭建

python+selenium环境搭建

selenium+python环境搭建

selenium+python环境搭建