如何安装Selenium for Python和C#
我正在努力遵循在windows机器上安装Selenium的说明,我需要它来支持Python 7.5和C#平台 我运行命令:如何安装Selenium for Python和C#,c#,python,selenium,C#,Python,Selenium,我正在努力遵循在windows机器上安装Selenium的说明,我需要它来支持Python 7.5和C#平台 我运行命令: D:\selenium-2.37.2> D:\Python27\python setup.py install 我明白了: Traceback (most recent call last): File "setup.py", line 17, in <<module>> from setuptools import setup I
D:\selenium-2.37.2> D:\Python27\python setup.py install
我明白了:
Traceback (most recent call last):
File "setup.py", line 17, in <<module>>
from setuptools import setup ImportError: No module named setuptools
回溯(最近一次呼叫最后一次):
文件“setup.py”,第17行,在
从setuptools导入安装导入错误:没有名为setuptools的模块
安装工具?呃。。。那是什么?我当然查过了,但考虑到所有建议,没有办法做到这一点
在Win7 for python上安装Selenium有可靠的方法吗?您尝试过吗
根据这篇文章,使用easy_install可能会更好。
Windows 7:
1. Install PyCharm education Edition IDE with Python 2.7 (JetBrains: https://www.jetbrains.com/pycharm-educational/)
2. Setup easy install (windows - simplified)
a. download ez.setup.py (https://bootstrap.pypa.io/ez_setup.py) from 'https://pypi.python.org/pypi/setuptools'
b. move ez.setup.py to C:\Python27\
c. open cmd prompt
d. cd C:\Python27\
e. C:\Python27\python.exe ez.setup.py install
3. Setup selenium webdriver for python
a. Download selenium source code from pypi : selenium-2.45.0.tar.gz from https://pypi.python.org/pypi/selenium
b. unzip it using 7Z software
c. open cmd prompt
d. cd to selenium-2.45.0 unzipped directory
e. C:\Python27\python.exe setup.py install
4. Test selenium webdriver for python
a. Open PyCharm IDE
b. create a new python file with the following contents:
from selenium import webdriver
browser=webdriver.Firefox()
browser.get('http://seleniumhq.org/')
c. Run the python script
d. Firefox browser will open and navigate to the intended website
5. Done!