stating:
This essay explains the construction of Selenium+python Automation environment, this essay does not introduce SELENIUM3,SELENIUM3 need to consider environment-dependent driver and other related questions more than one essay can not say, so the temporary not introduced, Of course you can use selenium2 deepen the understanding of Python+selenium work mechanism, SELENIUM3 read the official documents there is no pit;
Recommended environment: PYTHON2.7+SELENIUM2+FIREFOX46 The following versions (no driver required)
Other environment: python3.6+selenium3+firefox47 or above (requires Firefox driver)
Build steps:
First, download Python:
Website address: https://www.python.org/downloads/
Second, the installation of Python:
1,. The installation process is relatively simple: double-click the Python-2.7.14.msi after the default, all the way to the next step, until the installation is complete;
2. Configure Environment variables: (Take win10 as an example)
Right-click My computer → properties → advanced system settings → environment variables → system variables list select path→ edit → Add the following two variables:
Third, download installs selenium: (note here is SeLenium2 's package, must be under 3 package)
1. Download the jar package below 3.0 (Note: Must be 3.0 or less): http://download.csdn.net/download/xiaxiandong2012/6595607
2, decompression selenium jar package after the cmd command into the execution installation: C:\tools\selenium-2.48.0>python setup.py Install
3. In the case of networking, you can also use the PIP installation in cmd:
Pip Install selenium==2.53.6 (the version number is behind the = = number)
Iv. Download and install Pywin32:
1. Website address: https://sourceforge.net/projects/pywin32/files/pywin32/Build%20218/
Select Download according to your own computer and Python version number, such as 32-bit python2.7: pywin32-218.win32-py2.7.exe/download
Download and install XLRD, xlutils (read and write Excel related files to do data layering)
Online installation of direct cmd command in the case of networking:
Pip Install Xlrd
Pip Install Xlutils
VI. Install MySQL database driver file:
Online installation of direct cmd command in the case of networking: Easy_install Mysqldb-python
The above basic environment has been configured, remember that the Firefox version is not too high, more than 47 need to drive, no corresponding version of the driver of the small partner can contact the author qq:1277207158, no 47 version of Firefox browser environment related issues Welcome to add my qq discussion; thks;
Selenium_python Automation Environment Construction article