selenium + python 环境安装(转)

安装程序
python-2.7.2.msi,python安装程序
setuptools-0.6c11.win32-py2.7.exe,安装selenium必备软件
pip-1.0.2.tar.gz
selenium-2.18.1.tar.gz(pip命令下载安装),selenium安装程序
selenium-ide-1.6.0.xpi,firefoxWebDriver
selenium-server-standalone-2.18.0.jar,ieWebDriver
chromedriver.exe(chromedriver_win_18.0.1022.0.zip ),chromeWebDriver
ufida.zip
安装python       
双击安装python-2.7.2.msi即可。建议安装在默认路径:C:\Python27
添加环境变量Path:C:\Python27
安装验证:cmd命令中,输入python,进入python command line模式
安装setuptools
双击安装setuptools-0.6c11.win32-py2.7.exe即可。
安装路径C:\Python27\Lib\site-packages
必须安装setuptools,是因为pip和selenium的安装文件setup.py中使用。
安装 pip
解压pip-1.0.2.tar.gz,将解压文件放到C:\下,在DOS环境进入C:\pip-1.0.2,执行命令:python setup.py install。请注意安装路径。
默认在:C:\Python27\Scripts。
安装 selenium
进入pip.exe所在路径,运行命令行:pip install -U selenium。(需要网络,出现下列错误.忽略)
D:\Python27\Scripts>pip install -U selenium
Downloading/unpacking selenium
   Downloading selenium-2.24.0.tar.gz (1.9Mb): 1.9Mb downloaded
   Running setup.py egg_info for package selenium
     D:\Python27\lib\distutils\dist.py:267: UserWarning: Unknown distribution option: 'src_root'
       warnings.warn(msg)

    warning: no files found matching 'docs\api\py\index.rst'
Installing collected packages: selenium
   Found existing installation: selenium 2.24.0
     Uninstalling selenium:
       Successfully uninstalled selenium
   Running setup.py install for selenium
     D:\Python27\lib\distutils\dist.py:267: UserWarning: Unknown distribution option: 'src_root'
       warnings.warn(msg)

    warning: no files found matching 'docs\api\py\index.rst'
Successfully installed selenium
Cleaning up...
安装webdriver
安装firefox webdirver
     将selenium-ide-1.6.0.xpi拖进firefox浏览器,即开始安装
     Firefox浏览器选装firebug、FirePath插件
安装chrome webdriver
     解压chromedriver.exe到Python的安装目录下,如C:\Python27。
     添加C:\Users\Administrator\AppData\Local\Google\Chrome\Application\(chrome安装路径,这里是win7下的安装路径)到环境变量path
安装 ie webdriver
     复制IEDriverServer.exe到C:\Python27
     设置IE浏览器,Internet选线安全,把各模式的“启动保护模式”设置成一样(或者全部启动,或者全部不启动)。
自定义模块

http://www.51autotest.com/forum.php?mod=viewthread&tid=2211&reltid=2224&pre_thread_id=1833&pre_pos=1&ext=

猜你喜欢

转载自cyf0110.iteye.com/blog/1748564