手抄报 安全手抄报 手抄报内容 手抄报图片 英语手抄报 清明节手抄报 节约用水手抄报

Windows7+Python环境安装Selenium及Firefox驱动

时间:2024-11-21 12:29:48

1、在python安装目录下的script目录,按住shift然后单击鼠标右键,就能打开cmd(命令行窗口)窗口。

Windows7+Python环境安装Selenium及Firefox驱动
Windows7+Python环境安装Selenium及Firefox驱动
Windows7+Python环境安装Selenium及Firefox驱动

2、按下图输入,即可安装selenium。,笔者已经安装过selenium,所以显示already。

Windows7+Python环境安装Selenium及Firefox驱动

3、安装完selenium后,接下来就是浏览器驱动的安装了。笔者只演示了Firefox驱动的安装,其它浏览器驱动与此相同。下载完成后进行解压,然后将geckodriver.exe分别移动到python根目录和Firefox的根目录即可。

Windows7+Python环境安装Selenium及Firefox驱动
Windows7+Python环境安装Selenium及Firefox驱动
Windows7+Python环境安装Selenium及Firefox驱动
Windows7+Python环境安装Selenium及Firefox驱动

4、到现在安装工作都做完了,打开python的IDLE进行测试。如下图:

Windows7+Python环境安装Selenium及Firefox驱动
© 手抄报圈