Selenium环境搭建

1,手动下载selenium-3.14.0.tar.gz,地址:https://pypi.org/project/selenium/#files

2,将文件解压

3,打开命令行窗口,进入XX:selenium-3.14.0selenium-3.14.0,执行python setup.py install

4,安装完成后,打开命令行窗口,输入import selenium,不报错,即验证selenium安装成功

5,下载浏览器对应的驱动包:

点击进入后,选择对应版本:

6,下载后,将解压出来的.exe文件放到python的安装目录中

7,验证:

from selenium import webdriver

browser = webdriver.Firefox()
browser.get('https://www.baidu.com')
原文地址:https://www.cnblogs.com/lp475177107/p/11112859.html