python+selenium+chrome driver 64位环境配置

新换了电脑,重新配置下环境,备忘下

1.python2安装

https://www.python.org/downloads/release/python-2714/

下载64位双击安装

配置环境变量,将对应的目录添加path

C:Python27和C:Python27Scripts(pip的路径)

验证cmd输入python

2.selenium安装,使用pip安装

C:Windowssystem32>pip install selenium

这样下载的是selenium3 “ Successfully installed selenium-3.141.0 urllib3-1.24.1”

验证

python环境import selenium

3.chromedriver安装

http://chromedriver.storage.googleapis.com/index.html,可惜没有我要的64位driver啊

版本 70.0.3538.110(正式版本) (64 位)

下载个win32试试,

解压后将exe文件拷贝到chrome的目录下C:......lGoogleChromeApplication

将C:......lGoogleChromeApplication这个目录添加到环境变量path中

4验证环境

>>> from selenium import webdriver >>> dr=webdriver.Chrome()

DevTools listening on ws://127.0.0.1:62805/devtools/browser/7c83c3a9-7fe7-43be-9fdc-02c824a59290 >>> dr.get(https://www.baidu.com/) >>>

成功

新换了电脑,重新配置下环境,备忘下 1.python2安装 https://www.python.org/downloads/release/python-2714/ 下载64位双击安装 配置环境变量,将对应的目录添加path C:Python27和C:Python27Scripts(pip的路径) 验证cmd输入python 2.selenium安装,使用pip安装 C:Windowssystem32>pip install selenium 这样下载的是selenium3 “ Successfully installed selenium-3.141.0 urllib3-1.24.1” 验证 python环境import selenium 3.chromedriver安装 http://chromedriver.storage.googleapis.com/index.html,可惜没有我要的64位driver啊 版本 70.0.3538.110(正式版本) (64 位) 下载个win32试试, 解压后将exe文件拷贝到chrome的目录下C:......lGoogleChromeApplication 将C:......lGoogleChromeApplication这个目录添加到环境变量path中 4验证环境 >>> from selenium import webdriver >>> dr=webdriver.Chrome() DevTools listening on ws://127.0.0.1:62805/devtools/browser/7c83c3a9-7fe7-43be-9fdc-02c824a59290 >>> dr.get(https://www.baidu.com/) >>> 成功
经验分享 程序员 微信小程序 职场和发展