PyCharm 安装完默认是python3
查看mac os默认python2安装路径
Last login: Sun Jul 15 18:41:16 on ttys000
y50@Y50:~$python
Python 2.7.10 (default, Oct 6 2017, 22:29:07)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> quit()
y50@Y50:~$which python
/usr/bin/python
y50@Y50:~$
PyCharm 新建项目 python2 选择本地默认路径
PyCharm python2.7 安装 selenium
安装Chromedriver
ChromeDriver - WebDriver for Chrome 官网下载地址
chromedriver.exe 拷贝到路径 /usr/local/bin/
测试用例
from selenium import webdriver
print "hello"
browser = webdriver.Chrome()
url = "https://www.baidu.com"
browser.get(url)
参考:
1.Mac OS环境配置chromedriver