Complete steps to build a Python + Selenium automation environment

Source: Internet
Author: User
This article mainly introduces the Python + Selenium automation environment to build the relevant information, the text will be achieved through the steps of the step by step introduction of very detailed, to everyone's study or work has a certain reference learning value, the need for friends below to see together

Objective

This article mainly introduced about the Python+selenium automation environment construction related content, shares out for everybody reference study, below words not to say, comes together to see the detailed introduction

Python +selenium+googledriver

Small white blood and tears installed so that constantly summing up writing experience is a thorough understanding after all the road

One, the installation of Python:

First go to Python's official website to download the installation package

2, after the download is complete as shown

3, double-click EXE file installation, such as, and in accordance with the area of the ring set, remember to tick the box, and then click Customize installation into the next step:

4, for the, you can use browse to customize the installation path, you can also click on the install installation, click on Install and then you can complete the installation.

5. Configure Environment variables: Configure the current in path, you Python.exe the installation path of the program, Note: as long as the installation path of this program, do not put the name of this file is also filled with half-width semicolon separated.

If you want to use the PIP later, you also need to put the Pip.exe installation path to the path meaning you have to configure at least two times, Pip used more convenient

6, in order to check whether our Python installation is successful, you can enter Python in the Command window query, such as the display of a message is successful, such as the display of the second picture of the information indicates an error.

Second, install Pycharm next

1, first download from the website pycharm: Click to open the link (link to: http://www.jetbrains.com/pycharm/download/), here to recommend a pycharm 2017.3 Chinese professional cracked version (attached to the Chinese package + Hack method), click here to download, after entering, for example, according to the operating system of their own computer to choose, for Windows system Select the area in the red circle.

2, after the download is completed such as:

3, directly double-click the download good exe file for installation, installed as follows:

Click Next to proceed to the next step:

Click Next to proceed to the next step:

Click Install for installation:

After the installation is complete, the interface appears, and the point level finish installs:

Let's create our own first program:

1. Click the Pycharm icon on the desktop to enter into the Pycharm as shown in:

2. We select the second one and click OK:

3, click on the Accept to enter the next step:

4. Click OK to enter the next step:

5, click Create New Project, enter the interface, the map location is to choose your installed Python locations, select OK, click Create.

6, in the interface, such as the mouse right click on the arrow points in the map, and then finally select the Python file, in the box that pops up fill in the file name (any fill in).

7, the file after the creation of a successful entry into the following interface, you can write their own program, of course, if you are not satisfied with the interface, you can set the background, here I will not elaborate (self-Baidu can).

Note: to have a cracked version of:

Because of the latest JetBrains released IntelliJ idea 15. PyCharm5.PhpStorm10.WebStorm 11 versions, but changed the registration method. The original registration code including the registration machine is no longer available.

Now there is a relatively simple registration method. Select "License Server" input "http://15.idea.lanyus.com/" click "OK" when registering to quickly activate JetBrains series products

Use the latest update path:

Http://idea.lanyus.com

Second, install the request module, and Webdriver

See Python's installation path below F:\Python\Scripts There is no Pip.exe

Note:PIP is the installation management tool, if the PIP version is too low, you can use the command above to upgrade the PIP, if there is no pip you need to install PIP, or directly with the external download package installation.

Available: 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 F:\Python\Scripts PIP program path.

(2) Input: Pipinstall-uselenium

(3) Check whether the selenium is installed, import selenium in the IDE, no error is the guide

Third, install Google's driver:

Download the Google drive that matches your current version: Be sure to match the current version

This error may occur if the mismatch is not matched:

Put it under your Google's installation path: C:\ProgramFiles (x86) \google\chrome\application

That's basically all you can do.

Configure the path to this driver in the environment variable.

(environment variable when the system automatically calls to start some programs to find the path.) )

Four: The hint will appear: remove this hint

Install this:

2. or configure it.

It is also possible to report this error:

Is Google Drive and browser mismatch

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.