Install selenium steps (use selenium in Python)

Source: Internet
Author: User

Pre-condition: Python pip is already installed in the system.

Step One: Enter the PIP installation directory in cmd, such as: D:\python34\scripts

Step Two: Execute the installation command: Pip install selenium after the installation of the browser-driven configuration

Step three: Download browser drivers on the Internet (Google, IE, Firefox, etc.)

Fourth step: Place the downloaded browser driver in the root directory of the Python-installed directory

Fifth Step: Configure the browser-driven path to the environment variables, such as: D:\python34\Chome.exe

Complete the above steps to test by entering the following code:

From selenium import Webdriver
From time import sleep
# Open Google Browser premise has been deployed good browser-driven environment
Driver = Webdriver. Chrome ()
# Specify the URL of the access in the Open browser
Driver.get ("http://baidu.com")
If can successfully open Google Browser and visit Baidu success, prove selenium environment build success

If the browser does not start successfully at run time, the following two reasons may exist:

1, browser-driven configuration to the environment variable is not configured successfully, restart the computer to try

2, browser driver download the wrong version, re-download a



Install selenium steps (use selenium in Python)

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.