pythonselenium基本操作(python2.7selenium测试环境搭建)

1、安装好python2.7,将python.exe所在目录设置到系统环境变量的path项里边;

2、安装setuptools:由于不支持64位,直接下载安装貌似有问题,可以打开http://peak.telecommunity.com/dist/ez_setup.py,复制里边的内容保存到一个文本文件,假设为c:\ez_setup.py,然后在DOS窗口使用以下命令安装:python c:\ez_setup.py 回车;

3、安装pip:setuptoolssetuptools安装后,会在python安装目录下的lib\scripts里边生成easy_install.exe等文件,切换到这个目录,使用easy_install pip指令安装pip;

4、安装selenium:切换到python安装目录下的lib\scripts,使用pip install selenium进行安装即可(必须联网状态)

附ez_setup.py内容:

#!python

"""Bootstrap setuptools installation

If you want to use setuptools in your package's setup.py, just include this

file in the same directory with it, and add this to the top of your setup.py::

from ez_setup import use_setuptools

use_setuptools()

If you want to require a specific version of setuptools, set a download

mirror, or use an alternate download directory, you can do so by supplying

the appropriate options to ``use_setuptools()``.

This file can also be run as a script to install or upgrade setuptools.

"""

import sys

DEFAULT_VERSION = "0.6c11"

DEFAULT_URL = "http://pypi.python.org/packages/%s/s/setuptools/" % sys.version[:3]

md5_data = {

'setuptools-0.6b1-py2.3.egg': '8822caf901250d848b996b7f25c6e6ca',

pythonselenium基本操作(python2.7selenium测试环境搭建)(1)

,

免责声明:本文仅代表文章作者的个人观点,与本站无关。其原创性、真实性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容文字的真实性、完整性和原创性本站不作任何保证或承诺,请读者仅作参考,并自行核实相关内容。文章投诉邮箱:anhduc.ph@yahoo.com

    分享
    投诉
    首页