PYTHON3+SELENIUM2 Environment Building on Mac

Source: Internet
Author: User

View current Python version

Terminal Enter Python, carriage return-->mac comes with Python, version number is 2.7 (Mac comes with Python2)

Download

1. Official website Download the required 3.0+ installation package, this

Installation

2. Fool-Type Installation

Set the default Python version to 3

1.Terminal under Input

Open ~/.bash_profile

Open configuration file

2. Environment variables written to Python:

Path="/library/frameworks/python.framework/versions/3.6/bin:${path}"

Export PATH (mine is 3.6)

3. Renaming python

Alias python= "/library/frameworks/python.framework/versions/3.6/bin/python3.6"

(Here I think it should be to modify the default boot Python path)

4.Terminal under Input

SOURCE ~/.bash_profile

5. Enter in Terminal: Python display version 3.0 +

Installing SELENIUM2

1.Terminal under Input:

Pip install selenium==2.xx.x xx to install the version number

The last version of SELENIUM2 is 2.53.6

You can enter PIP install selenium==2.53.6

A pattern with a progress bar indicates that you are downloading

After installation is complete

On the idle, enter:

From selenium import Webdriver

Driver = Webdriver. Firefox ()

Driver.get ("https://www.baidu.com")

Run the script

If you can successfully adjust the browser and open the page, congratulations, the environment installed successfully!

PYTHON3+SELENIUM2 Environment Building on Mac

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.