first, Download the relevant software
1.python
http://python.org/getit/
2.setuptools
Http://pypi.python.org/pypi/setuptools
3.pip
Https://pypi.python.org/pypi/pip
second, Installation and verification
1. Install Python
Python directly click on the application to run, the default installation in C:\Python27, after installation, you need to add C:\Python27 in the environment variable path of the system;
Verify that Python is installed successfully, open cmd, and then enter python--version at the command line. If you look at Python 2.7.9, it means that the installation and configuration of Python is successful;
So you can write a Python program. Open your own Idil (Python GUI) and write ' hello,world! ‘;
2. Installing Setuptools
Unzip the downloaded Setuptools and put it in the C:\pythoon27 folder.
Execute the following command in Cmd: C:\Python27\setuptools-28.7.1>python setup.py install;
After installing the setuptools, you can see the script directory under the PYTHON27 installation directory, then you need to add C:\Python27\Scripts this directory to the system Environment.
3. Install PIP
Unzip the downloaded PIP into the c:\python27 folder.
execute the following command in Cmd: C:\python27\pip-8.1.2>python setup.py install;
verify Pip and execute the following command in Cmd: C:\python27\scripts>pip
4. Installing Selenium
CMD execution command: c:\python27\scripts>pip install selenium;
Verify that the installation is Successful. Enter the Scripts directory and enter the following command:C:\python27\scripts>pip show Selenium ;
5. python+selenium, Run the automation script
Open the idle (python GUI) > File>new File
Enter the following code, save as test.py file, and click Run>run Module to Run. (prerequisite: Firefox installed)
#coding =utf-8
From selenium import Webdriver
Driver = Webdriver. Firefox ()
Driver.get ("http://www.baidu.com")
driver.find_element_by_id ("kw"). Send_keys ("testing")
driver.find_element_by_id ("su"). Click ()
Driver.quit ()
Python+selenium Environment Construction