本文主要是介绍mac os PyCharm 切换python2.7 安装selenium Chromederver配置,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
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
这篇关于mac os PyCharm 切换python2.7 安装selenium Chromederver配置的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!