常见浏览器 WebDriver 驱动下载

以下是常见浏览器 WebDriver 驱动的下载地址及注意事项,综合多个可靠来源整理而成:


一、Chrome 浏览器(ChromeDriver)

  1. 官方下载地址 http://chromedriver.storage.googleapis.com/index.html

    版本匹配 :需与 Chrome 浏览器版本对应,可通过浏览器地址栏输入 chrome://version/ 查看版本号。

  2. 注意事项

    • 若下载新版无对应驱动,推荐访问 Chrome for Testing 镜像站:https://googlechromelabs.github.io/chrome-for-testing/


二、Firefox 浏览器(GeckoDriver)

  1. 官方下载地址 https://github.com/mozilla/geckodriver/releases

    • 选择与 Firefox 版本兼容的驱动(通常最新版即可)。

  2. 安装说明

    • 解压后将 geckodriver.exe 放置于 Python 安装根目录或添加到系统环境变量 PATH


三、Microsoft Edge 浏览器(EdgeDriver)

  1. 官方下载地址 https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/
    严格版本匹配 :驱动版本需与 Edge 浏览器版本完全一致(通过 edge://settings/help 查看版本)。

四、Internet Explorer(IEDriverServer)

  1. 下载地址 https://selenium-release.storage.googleapis.com/index.html

    推荐版本:2.5.x 版本兼容 IE11。

  2. 配置要求

    • 需在 IE 的「Internet 选项」中取消勾选「启用保护模式」并设置缩放为 100%。


五、其他浏览器

  1. Safari

    • 内置驱动,无需额外下载,但需在「偏好设置」中启用「允许远程自动化」。

  2. 基于 Chromium 的浏览器 (如 QQ、360、Opera)

    • 使用 ChromeDriver,需在代码中指定浏览器和驱动的路径。


六、通用配置建议

  1. 环境变量配置

    • 将驱动文件(如 chromedriver.exe)放入 Python 安装目录或添加到系统 PATH

    • 示例代码指定驱动路径(以 Chrome 为例):

    python 复制代码
    from selenium import webdriver
    from selenium.webdriver.chrome.service import Service
    service = Service(r"D:\Drivers\chromedriver.exe")
    driver = webdriver.Chrome(service=service)
  2. 版本兼容性检查

    • 若启动报错,优先检查浏览器与驱动版本是否匹配,必要时降级浏览器或更新驱动。


相关推荐
深蓝电商API5 小时前
实战破解前端渲染:当 Requests 无法获取数据时(Selenium/Playwright 入门)
前端·python·selenium·playwright
卓码软件测评5 小时前
第三方软件验收测试:【AutoIt与Selenium结合测试文件上传/下载等Windows对话框】
windows·功能测试·selenium·测试工具·性能优化·可用性测试
最好的我们!14 小时前
解决selenium的EdgeOptions addArguments is not supported问题
selenium·测试工具
万粉变现经纪人1 天前
如何解决 pip install 安装报错 ImportError: cannot import name ‘xxx’ from ‘yyy’ 问题
python·selenium·测试工具·flask·scikit-learn·fastapi·pip
gc_22991 天前
学习Python中Selenium模块的基本用法(18:使用ActionChains操作鼠标)
python·selenium
paid槮3 天前
selenium完整版一览
selenium·测试工具
gc_22993 天前
学习Python中Selenium模块的基本用法(17:使用ActionChains操作键盘)
python·selenium
鱼鱼说测试3 天前
Selenium+python自动化1-环境搭建
python·selenium·自动化
Moshow郑锴3 天前
Java 中配置 Selenium UI 自动化测试 并生成 Cucumber 报告
java·selenium·测试工具
llm2009093 天前
UI自动化框架之Selenium八大元素定位(二)
selenium·ui·自动化