admin管理员组文章数量:1566673
1.首先pip安装selenium
pip install selenium
2.下载chromedriver驱动
(1)打开自己电脑上的谷歌浏览器,查看版本号,
然后chromedriver的版本一定要与Chrome的版本一致,不然下载不对应的版本,没作用。
(2)驱动下载地址
下面有两个下载地址:
1.https://npm.taobao/mirrors/chromedriver/
2.http://chromedriver.storage.googleapis/index.html
3 下载完成后解压,得到chromedriver.exe文件,
4 将此exe文件放入python安装目录下,
不用配置环境变量,不是chrome目录下
5 打开编译器,运行代码
from selenium import webdriver
driver = webdriver.Chrome()
driver.get("https://www.baidu/")
driver.close()
参考链接:https://blog.csdn/weixin_45109684/article/details/117650036
参考链接:https://blog.csdn/m0_43422224/article/details/104585477
参考链接:https://blog.csdn/ZQWQZ/article/details/122937765
版权声明:本文标题:使用selenium启动谷歌Chrome浏览器 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.elefans.com/xitong/1727565794a1121157.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论