preamble
This article is mainly about Python + selenium automation environment to build the content, share it for your reference and learning, the following words do not say much, come together to see the details of the introduction of it!
Python +selenium+googledriver
The blood and tears of the installation of the white man to make, non-stop summary of the write tips is to understand the thorough after all the road!
One, python installation:
First go to Python's official website and download the installer:/ , you can also download it through me:https:///softs/
2, after the completion of the download as shown below
3, double-click the exe file for installation, as shown below, and set up in accordance with the circle in the region, remember to check the tick box, and then click Customize installation to the next step:
4, for the above picture, you can customize the installation path through Browse, you can also directly click Install to install, click install will be able to complete the installation.
5. Configure environment variables: Configure the current installation path of your program in path.Attention:Just the installation path of this program, don't fill in the name of this file as well, separate it with a semicolon.
If you want to use pip at a later time, you also need to configure the installation path into the path, which means you have to configure it at least twice, pip is easier to use.
6, in order to check whether our python installation is successful, you can type python in the command window to query, such as the display of the following figure one of the information is said to be successful, such as the display of the second picture of the information is said to be an error.
Second, next install pycharm
1. First download pycharm from the website:Click to open link(the link is: /pycharm/download/), here to recommend a PyCharm 2017.3 Chinese professional crack version (with Chinese package + crack method).Click here to downloadAfter entering the following figure, according to their own computer operating system to choose, for windows system to choose the red circle in the picture of the area.
2、After the download is completed, the following figure:
3, directly double-click the downloaded exe file for installation, installation screenshots are as follows:
Click Next to go to the next step:
Click Next to go to the next step:
Click Install to install:
After the installation is complete, the following screen appears, tap Finish to end the installation:
Let's create our first program:
1, click the desktop pycharm icon, enter into the pycharm, as shown below:
2. We select the second one and click Ok:
3. Click Accept in the picture above to go to the next step:
4. Click ok in the picture above to go to the next step:
5, click Create New Project, enter the following interface, the figure of the Location is to choose the location of your installation of python, choose a good, click create.
6, in the interface into the following chart, the mouse right-click on the arrow in the figure pointing to the place, and then finally select python file, in the pop-up box to fill in the file name (fill in any).
7, after the successful creation of the file will enter the following interface, you can write your own program, of course, if you are not satisfied with this interface, you can set your own background, here I will not go into detail (Baidu can be).
Attention:Be available in a cracked version:
Since the latest jetbrains released IntelliJ IDEA 15. PyCharm5. 11 and other versions, but changed the registration method. The original registration code including the registration machine can no longer be used.
Now there is an easy way to register. When registering, select "License server" and enter "/" and click "OK" to quickly activate your JetBrains product.
Use the latest update path:
Second, install the request module and webdriver.
Check the Python installation path below F:\Python\Scripts There is no
Notes:pip is an installation management tool, if pip version is too low, you can use the above command to upgrade pip, if you don't have pip then you need to install pip, or directly use an external download package to install.
You can use: F:\Python\Scripts>easy_install.exe pip (update pip)
Install selenium:
(1) Using the cmd command window, switch to your Python installation path under the pip program path of F:\Python\Scripts.
(2) Type: pipinstall-Uselenium
(3) Check whether selenium is installed, in the IDE import selenium, no error means that the guide is good!
Three, install Google Drive:
Download Google Drive that matches your current version: Be sure to match the current version!
This error may occur if there is a mismatch:
Put it under your Google installation path: C:\ProgramFiles (x86)\Google\Chrome\Application
That will basically do it.
Configure the path to this driver in the environment variables.
(Environment variables are automatically invoked by the system to start some programs that are looking for paths.)
Four: this prompt will appear: remove this prompt
Install this:
2. Or configure it.
There is also the possibility of reporting this error:
It's Google Drive and browser mismatch
summarize
Above is the entire content of this article, I hope that the content of this article on your learning or work has a certain reference learning value, if there are questions you can leave a message to exchange, thank you for my support.