Python+selenium environment construction and the pits encountered

Source: Internet
Author: User

---restore content starts---

environment construction under WINDOW10

1. Install Python

https://www.python.org/downloads/Download the latest version of Python under this URL, click Install, select Add Python path to PATH environment variable during installation

2. Installing Setuptools and Pip

Setuptools makes it easier to create and publish Python packages, especially if you have dependencies on other packages

Pip is a tool for installing and managing Python packages, installation relies on Setuptools, and using the PIP command to better install Python third-party libraries

3. Installing Selenium

Enter PIP install selenium on the cmd command line to install Selenuim

4. I'm using pycharm for encoding.

Some of the pits encountered

1. Run a small example with Webdriver to meet the pit below

Selenium is a big change from the previous one, one of which is that Webdriver is separated from the browser and needs to be installed separately

Download : https://github.com/mozilla/geckodriver/releases

Unzip: Customize an address, remember that address

Environment variables: Add decompressed addresses to environment variables

2. Baidu a lot, finally thought to solve this problem, but found another problem, session creation exception

Tears ran, find a lot of information, just know is to follow the current download the highest version of the Geckodriver, nonsense not to say, download the previous version, find a 15.0 version of the reinstallation

At this point, the program can run.

Python+selenium environment construction and the pits encountered

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.