Python web automation environment to build

This paper describes the content on Python + selenium automation environment to build, share it for reference learning

Tools: + Python + pip + selenium + webdriver (drive) pycharm

First, install Python

1, first go to the official website to download and install the Python Package: https: //www.python.org/  

 

 2, after the successful installation of Python, configure the environment variables (Python installation path): the current configuration, installation path you Python.exe program in the path, note: as long as the installation path of this program, not the name of this file can also fill in , separated by a semicolon.

My installation path: E: \ Program Files (x86) \ Python36

3, in order to check our python is installed successfully, you can enter python query in a command window, the following chart indicates success:

 

 Two, pycharm

1, download pycharm: http: //note.youdao.com/noteshare id = 993434ac8f4e192f650cffbdd078e412 (Ethics cloud notes sharing)?

After the download is complete as shown below:

 

Third, the installation installed pip

1. Before installing pip, make sure win system python, and easy_install tool already installed, if the system is successfully installed, easy_install in the directory C: \ Python27 \ Scripts below, confirm that shots are as follows: 

2, and then switch to the next directory in the Script file folder python installation directory, run the installation easy_inatall pip pip

3, configuration pip environment variables: path = E: \ Program Files (x86) \ Python36 \ Scripts

4, the installation was successful check pip, open cmd command window, enter the pip, as shown below the installation was successful:

Fourth, install selenium

(1) Open the cmd command window, switch to your installation path following Python, E: \ Python36 under Program Files (x86) \ \ pip Scripts the program path.

(2) may be directly installed through pip command input: pip install selenium, press enter performed

(3) Check whether the installed selenium, Python input in cmd, and enter from selenium import webdriver, then enter webdriver.Chrome () appears at FIG installation was successful

Fifth, install the browser driver

We go to download their browser, select the drive corresponding version of it: http: //chromedriver.storage.googleapis.com/index.html

My chrome version:

 

 Select the Webdriver drive version:

Guess you like

Origin www.cnblogs.com/pwj2lgx/p/11635386.html