Selenium库和ChromeDriver谷歌驱动最新版安装

1.安装selenium库

使用pip安装第三方库selenium,速度较慢。

pip install selenium

使用国内清华源安装第三方库selenium,速度较快。

pip install selenium -i https://pypi.tuna.tsinghua.edu.cn/simple

2.安装谷歌浏览器驱动

驱动下载链接:
http://chromedriver.storage.googleapis.com/index.html

先查看电脑按照的谷歌浏览器的版本,浏览器的版本和驱动的版本一定要一致 ,查看版本的操作如图所示:
在帮助中点击关于google chrome,然后便可以查看到浏览器的版本

上述链接中没有最新的谷歌浏览器驱动,然后在这个链接中可以找到。
Chrome for Testing availability

接着就需要在电脑的高级系统环境中设置谷歌浏览器驱动的路径

3.完成环境配置

(1) 点击我的电脑/此电脑->右键点击属性->点击高级系统设置->环境变量->系统变量。

(2)点击系统变量中的path,点击新增,并将chromeDriver的安装目录复制填入后,点击确定。

4.进行测试

python 复制代码
from selenium import webdriver
driver = webdriver.Chrome()

5.参考文章

1.https://blog.csdn.net/weixin_62854251/article/details/127590724

2.ChromeDriver谷歌驱动最新版安装118/119/120

本篇文章是对上述两篇文章学习和使用的记录。

相关推荐
2601_962295332 小时前
如何python实现网页的自动化
python·selenium·beautifulsoup·requests·网页自动化
程序员小远10 小时前
自动化测试用例编写实例详解
自动化测试·软件测试·python·selenium·测试工具·职场和发展·测试用例
2601_962298271 天前
Python与Selenium结合的Web自动化测试全流程实践教程
自动化测试·python·selenium·web测试·pageobjectmodel
2601_962298271 天前
【自动化测试】基于Selenium + Python的web自动化框架
自动化测试·python·selenium·测试用例·web框架
2601_962295582 天前
python+selenium实现自动化测试
自动化测试·python·selenium·学习心得·web端测试
亚林瓜子2 天前
Google的编程Agent:antigravity CLI自动模式
ai·google·spec·coding·cli·auto·agy
B2_Proxy3 天前
Selenium配置代理IP的完整指南:从启动参数到认证扩展
selenium·测试工具
weixin_440730504 天前
Playwright介绍、特点、小例子还有与传统selenium的区别
selenium·测试工具·playwright
2601_962387825 天前
web自动化测试实战教程【selenium/unittest/pytest】【共193课
selenium·pytest·devops·web自动化测试·unittest