


Complete steps to build Python + selenium automation environment
This article mainly introduces you to the relevant information about the construction of Python selenium automation environment. The steps of implementation are introduced in detail step by step through pictures and texts. It has certain reference learning value for everyone's study or work. It needs Friends, let’s take a look together
Preface
This article mainly introduces the relevant content about the construction of Python selenium automation environment and share it. For your reference and study, I won’t say much below, let’s take a look at the detailed introduction
Python selenium googledriver
Xiaobai’s Blood and Tears installation tool, the constant summary and writing experience is understanding The thorough and final road
1. Python installation:
First go to Python’s official website to download the installation package
2. After the download is completed, as shown in the figure below
3. Double-click the exe file to install, as shown in the figure below, and set according to the area in the circle , remember to check the checked box, and then click Customize installation to enter the next step:
4. For the above picture, You can customize the installation path through Browse, or click Install directly to install. Click install to complete the installation.
5. Configure environment variables: Configure the current installation path of your Python.exe program in path, Note: As long as the installation path of this program is required, do not also fill in the name of this file, separate it with a semicolon.
If you want to use pip later, you also need to add the installation path of pip.exe to path. This means that you need to configure it at least twice. It is more convenient to use pip.
6. In order To check whether our python is installed successfully, you can enter python in the command window to query. If the information in the first picture below is displayed, it means success. If the information in the second picture is displayed, it means an error has occurred.
Second, install pycharm
1. First download pycharm from the website: click to open the link (the link is: http://www.jetbrains.com/pycharm/download/). Here I recommend a PyCharm 2017.3 Chinese professional cracked version (with Chinese package cracking method), click here Download and enter as shown below. Select according to your computer's operating system. For Windows systems, select the area circled in red in the picture.
2. After the download is completed, the following figure is shown:
3. Double-click the downloaded exe file to install it. The installation screenshot is as follows:
Click Next to proceed to the next step:
Click Next to proceed to the next step:
Click Install to install:
After the installation is completed, the following interface will appear. Click Finish to complete the installation:
Let’s create our first program:
1. Click the pycharm icon on the desktop to enter pycharm, as shown below Shown:
2. We select the second one and click Ok:
3. Click on the image above Accept in to go to the next step:
4. Click ok in the above picture to enter the next step:
5. Click Create New Project and enter the following picture Interface, the Location in the picture is to select the location of the python you installed. After selecting, click create.
#6. In the interface shown below, right-click where the arrow in the picture points, then select python file and fill in the file name in the pop-up box (any fill in).
#7. After the file is created successfully, you will enter the following interface and you can write your own program. Of course, if you are not satisfied with this interface, you can set the background yourself. I won’t explain it in detail here (just use Baidu yourself).
Note: Requires a cracked version:
Since the latest jetbrains released IntelliJ IDEA 15. PyCharm5.PhpStorm10.WebStorm 11 and other versions, but the registration method has been changed. The original registration code, including the registration machine, can no longer be used.
Now there is a relatively simple registration method. When registering, select "License server" and enter "http://15.idea.lanyus.com/" and click "OK" to quickly activate JetBrains series products
Use the latest update path:
http://idea.lanyus.com
## Second, install the request module and webdriver
Check the Python installation path under F:\Python\Scripts to see if there is pip.exe##Note: pip is an installation management tool. If the pip version is too low, you can use the above command to upgrade pip. If there is no pip, you need to install pip, or install it directly with an external download package. You can use: F:\Python\Scripts>easy_install.exe pip (update pip)
Install selenium:(1) Use cmd In the command window, switch to your Python installation path, under the pip program path of F:\Python\Scripts.
(2) Enter: pipinstall-Uselenium
(3) Check whether selenium is installed and import selenium in the IDE. If no error is reported, it means it is installed
Third, install Google’s driver: Download the Google driver that matches your current version: it must match the current version
If it does not match, it is possible This error occurs:
# Place it under your Google installation path: C:\ProgramFiles (x86)\Google\Chrome\Application
Basically this way That's it.
Configure the path of this driver in the environment variable.
(Environment variables are the search paths that the system automatically calls to start some programs.)
Four: This prompt will appear: Remove this prompt
Install this:
2. Or configure it
and you may report this error:
is a mismatch between the Google driver and the browser
The above is the detailed content of Complete steps to build Python + selenium automation environment. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

PHP is mainly procedural programming, but also supports object-oriented programming (OOP); Python supports a variety of paradigms, including OOP, functional and procedural programming. PHP is suitable for web development, and Python is suitable for a variety of applications such as data analysis and machine learning.

PHP is suitable for web development and rapid prototyping, and Python is suitable for data science and machine learning. 1.PHP is used for dynamic web development, with simple syntax and suitable for rapid development. 2. Python has concise syntax, is suitable for multiple fields, and has a strong library ecosystem.

Python is more suitable for beginners, with a smooth learning curve and concise syntax; JavaScript is suitable for front-end development, with a steep learning curve and flexible syntax. 1. Python syntax is intuitive and suitable for data science and back-end development. 2. JavaScript is flexible and widely used in front-end and server-side programming.

VS Code can run on Windows 8, but the experience may not be great. First make sure the system has been updated to the latest patch, then download the VS Code installation package that matches the system architecture and install it as prompted. After installation, be aware that some extensions may be incompatible with Windows 8 and need to look for alternative extensions or use newer Windows systems in a virtual machine. Install the necessary extensions to check whether they work properly. Although VS Code is feasible on Windows 8, it is recommended to upgrade to a newer Windows system for a better development experience and security.

VS Code can be used to write Python and provides many features that make it an ideal tool for developing Python applications. It allows users to: install Python extensions to get functions such as code completion, syntax highlighting, and debugging. Use the debugger to track code step by step, find and fix errors. Integrate Git for version control. Use code formatting tools to maintain code consistency. Use the Linting tool to spot potential problems ahead of time.

PHP originated in 1994 and was developed by RasmusLerdorf. It was originally used to track website visitors and gradually evolved into a server-side scripting language and was widely used in web development. Python was developed by Guidovan Rossum in the late 1980s and was first released in 1991. It emphasizes code readability and simplicity, and is suitable for scientific computing, data analysis and other fields.

In VS Code, you can run the program in the terminal through the following steps: Prepare the code and open the integrated terminal to ensure that the code directory is consistent with the terminal working directory. Select the run command according to the programming language (such as Python's python your_file_name.py) to check whether it runs successfully and resolve errors. Use the debugger to improve debugging efficiency.

VS Code extensions pose malicious risks, such as hiding malicious code, exploiting vulnerabilities, and masturbating as legitimate extensions. Methods to identify malicious extensions include: checking publishers, reading comments, checking code, and installing with caution. Security measures also include: security awareness, good habits, regular updates and antivirus software.
