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