Get the App
SLTechnology News&Howtos  ›  Development  › 

How to build Selenium+Python Automation script Environment

Shulou Source: shulou.com Published: 2022-06-03 14:30:43 11月14日 Update

This article will give you a detailed explanation on how to build a Selenium+Python automation script environment. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.

1. Build the Python environment 1. Download the installation package

Https://www.python.org/downloads/windows/

After the download is complete, open and install, tick the add path below, and then OK the next step.

2. Verify whether the installation is successful and whether pip is available.

After the installation is successful, open the command window (win+R, enter and exit cmd, enter). Enter python-- version to display the normal version.

Similarly, enter pip-- version to verify whether pip is installed. If prompted that there is no such command or there is an error, execute the following two commands to python-m pip uninstall pip setuptools.

Pip install-upgrade setuptools

3. Install Selenium libraries

Open a command window and type pip install selenium to wait for the installation to complete

Install Google browser and WebDriver1, install Google browser

Https://www.google.cn/intl/zh-CN/chrome/

Download and install it.

2. Download WebDriver

Check the version of the browser you installed first

I have here the 93.0.4 version.

Then go to https://chromedriver.storage.googleapis.com/index.html.

Download the WebDriver corresponding to your browser version (as long as the first three numbers are right)

3. Configure environment variables

First decompress the WebDriver you just downloaded to get an executable file chromedriver

Copy it to the Google browser directory. The default path is C:\ Program Files\ Google\ Chrome if you change it during installation, go to the path you changed.

And then

Right-click my computer-"Properties -" Advanced system Settings-"system Properties -" Advanced-"Environment variable -" user variable Path- Edit-"New -" enter the path you just stored

(for example: C:\ Program Files\ Google\ Chrome)

And then make sure all the time.

4. Verify that WebDriver is installed successfully

Open a command window and enter chromedriver if there is a display of Starting ChromeDriver. A pile of information represents success.

This is the end of this article on "how to build an Selenium+Python automation script environment". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it out for more people to see.

Tags: Environment commands browser browsing input success version variables articles paths validation scripts Automation Advanced Properties more system good practical right Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno MySQL Huawei Docker vpn