温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

python3+selenium访问网页时的驱动

发布时间:2020-07-23 21:44:19 来源:网络 阅读:355 作者:白话 栏目:编程语言
selenium的安装

直接通过pip install selenium就可以安装了,非常简单。

使用Firefox时

报错:selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.
说明没有安装Firefox的驱动。

下载地址

https://github.com/mozilla/geckodriver/releases
下载适合自己的包。

使用Chrome时

报错:selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH.
说明没有安装Chrome的驱动。

下载地址

http://chromedriver.storage.googleapis.com/index.html
下载是自己的包。

其他

IE浏览器:http://selenium-release.storage.googleapis.com/index.html
Edge浏览器:http://go.microsoft.com/fwlink/?LinkId=619687

驱动的存放位置

在Windows下,需要将下载的包解压后,放到Python的根目录下,指定目录应该也是可以的,毕竟Linux都可以呢。
在Linux下,我就是放到了与脚本同路径下,然后在程序里写的全路径。

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI