1. 安装selenium库

切换到pip所在文件夹,并安装

c:\>cd /d d:\
d:\>cd Python\Python36\Scripts
d:\Python\Python36\Scripts>pip.exe install selenium

安装成功

Collecting selenium
  Downloading https://files.pythonhosted.org/packages/b8/53/9cafbb616d20c7624f
f31bcabd82e5cc9823206267664e68aa8acdde4629/selenium-3.14.0-py2.py3-none-any.wh
l (898kB)
    29% |█████████▌                      | 266kB 1.4MB/s eta 0:00:01
    ...
    ...
    ...
1kB 1.3MB/s
Requirement already satisfied: urllib3 in d:\python\python36\lib\site-paRequirement already satisfied: urllib3 in d:\python\python36\lib\site-
 (from selenium) (1.23)
Installing collected packages: selenium
Successfully installed selenium-3.14.0

 

 

2. 使用FireFox下载geckodriver,使用chrome下载chromedriver

geckodriver地址:https://github.com/mozilla/geckodriver/releases

chromedriver地址:http://chromedriver.storage.googleapis.com/index.html

注意:chromedriver版本需要与浏览器版本匹配,参考地址:https://blog.csdn.net/huilan_same/article/details/51896672

 

 

3. 解压后将exe文件放到python根目录下 D:\Python\Python36

20180827162537.png

posted on 2021-08-07 21:54  讲道理好嘛  阅读(78)  评论(0编辑  收藏  举报