Win10 under the Selenium + Python environment setup

Source: Internet
Author: User

Written in the previous words: 2017 There are too many distractions and slack. Things are stagnant in many ways, and the end-of-year version is still a problem, deeply remorse and uneasy. Hope that the coming year will be serious, focus and perseverance.

A few days ago to change the computer, just reconfigure a variety of environments, but also want to re-learn the knowledge of automation.

What I want to record today is about the environment of selenium and python.

Actually, it's easy to say.

It's just a few steps.

1. Install Python (3.5.4)

2. Installing Selenium

3. Configure the browser driver

1. Python Installation

-Go to https://www.python.org/downloads/and find the version that needs to be downloaded, I chose 3.5.4

Web-based: Installed through the network, is to perform the installation before downloading Python through the network

Executable: Executable files, both to install the Python to download all the local installation

embeddable zip file:zip compressed file, Python packaged as a ZIP archive package

In fact, the content is the same, I choose a good, I chose EXE installation.

-Double-click to run after downloading well.

After the installation is complete, go to cmd to see if the Python installation is successful and if the Python version information is successfully printed, the installation is successful.

-Configure Environment variables

Right-click My Computer-Properties-Advanced system settings-environment variable-path

To write the installation path of Python

C:\xxx\Python\Python35

2. Installing Selenium

There are many ways to install the selenium, I use the PIP way

Enter the Python35\scripts directory

Shift-click the right mouse button-open the Powshell window here

Run pip Install Selenium

You can use the PIP list to view the installation after the installation is complete

3. Configure browser driver (Chrome only)

Download Chromedriver

The official website seems to be wall, find a mirror on the net

http://npm.taobao.org/mirrors/chromedriver/

The corresponding version is as follows

When the download is complete, place it in the Chrome installation directory and put the Chrome installation directory in the environment variable

Test code

 from Import  = webdriver. Chrome () driver.get('http://baidu.com')print(driver.title)

To run smoothly, you are done.

Win10 under the Selenium + Python environment setup

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.