You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何通过Selenium控制原生Chrome浏览器(无需ChromeDriver)

可行,以下是实现方式

直接启动chrome.exe完全可行,这本质上和你手动双击Chrome图标打开浏览器是同一个逻辑,不会通过ChromeDriver这类自动化驱动程序,启动的就是你日常使用的带个人配置的Chrome实例。

不同环境下的实现方法:

  • Windows 命令行:直接在CMD或PowerShell里执行:

    start chrome.exe
    

    如果Chrome不在系统PATH里,需要指定完整路径,比如:

    start "C:\Program Files\Google\Chrome\Application\chrome.exe"
    
  • Python 代码:用subprocess模块调用系统命令:

    import subprocess
    # 若Chrome在PATH中
    subprocess.call(["chrome.exe"])
    # 或指定完整路径
    subprocess.call(['C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe'])
    
  • macOS 终端:执行:

    open -a "Google Chrome"
    
  • Linux 终端:执行:

    google-chrome
    

关键说明:

  • 这种方式启动的Chrome会自动加载你的个人配置文件(书签、扩展、浏览历史等),和你日常手动打开的完全一致。
  • 和ChromeDriver启动的实例不同,直接启动的Chrome没有自动化控制能力,只能像普通用户操作一样使用,无法通过代码自动完成点击、填写表单等操作。

内容的提问来源于stack exchange,提问作者Mateus Brandeburski Ramos

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.01 22:10:35