This article introduces you to the automated environment construction (Python-selenium). Friends in need can refer to the content in the article
Step one: Install Python
Access Python Official website: http://www.Python.org. Find the download page and download the Python 2.7 version (the 2.7 and 3.5 versions are quite different. Currently, we will use 2.7 as an example). For Windows users, if it is a 32-bit operating system , select the x86 version; if the operating system is 64, select the 64 version.
After the download is completed, double-click to install.
After the installation is complete, open the IDLE that comes with Python, and the following picture will pop up, and you can write Python programs.
#Alternatively, you can enter python shell mode by entering the python command at the Windows command prompt.
Note: If you are prompted that python is not an internal or external command, you need to add the python installation directory to the path of the system environment variable. Right-click My Computer-Open the right-click menu-Properties-Advanced-Environment Variables-System Variables and add it to the path, as shown below:
Step 2 :Install setuptools and pip
The download address of setuptools and pip is as follows:
https://pypi.Python.org/pypi/setuptools
https://pypi. Python.org/pypi/pip
Download through the above address. After the download is completed, unzip it and you will get the corresponding folder. Enter the decompression directory at the Windows command prompt and execute setup.py through the python command to install.
However, pip has been integrated into the latest python version installation package. You can check whether there is pip.exe or pip3.exe in the python installation directory. If there is a file, you can directly enter pip or pip3 at the Windows command prompt. If the following message appears, it means the installation has been successful.
Step 3: Install selenium
The selenium package can be installed directly through the pip command:
Step 4: Install ActivePython
The download address is as follows:
https://www.activestate.com/activePython/downloads
The installation steps are the same as python. After the installation is complete, you can use the pip command to install the selenium library in the same way. The process is the same as above.
Related recommendations:
Use PostMan for automated testing
The above is the detailed content of Automated environment construction (Python-selenium). For more information, please follow other related articles on the PHP Chinese website!