部署 Browser-Use WebUI + DeepSeek 实现浏览器AI自动化

一、安装部署

1.安装 python3.11 或以上版本

2.安装browser-use

pip install browser-use

3.安装 Playwright

playwright install

4.安装项目依赖

pip install langchain-google-genai==2.0.8
pip install pyperclip==1.9.0
pip install gradio==5.9.1
pip install langchain-ollama==0.2.2
pip install langchain-openai==0.2.14

5.配置环境变量

5.1 下载整个项目到本地,解压

https://github.com/browser-use/web-ui

5.2 将 .env.example 复制修改为 .env,并设置你的环境变量,包括 LLM 的 API 密钥(可以不在此处修改,在后续Web端设置)

5.3 如果使用你自己的浏览器,而不是playwright安装的

  • 设置 CHROME_PATH 为浏览器的可执行文件路径(例如,Windows 上为 C:\Program Files\Google\Chrome\Application\chrome.exe)
  • 设置 CHROME_USER_DATA 为浏览器的用户数据目录(例如,C:\Users\AppData\Local\Google\Chrome\User Data)

6.启动(启动前关闭所有chorme)

python webui.py --ip 127.0.0.1 --port 7788
注:此时启动会报以下错误:

ImportError: cannot import name 'AgentStepErrorTelemetryEvent' from 'browser_use.telemetry.views' (D:\Python312\Lib\site-packages\browser_use\telemetry\views.py). Did you mean: 'AgentStepTelemetryEvent'?
原因:
我们找到 D:\Python312\Lib\site-packages\browser_use\telemetry\views.py 这个文件打开,发现里面没有 AgentStepErrorTelemetryEvent 这个类,实际应该是 AgentStepTelemetryEvent 这个类;而 D:\browser-use-webui\src\agent\custom_agent.py 中导入的是 AgentStepErrorTelemetryEvent 这个类,所以导致启动报错
解决方法:
此时我们将 D:\browser-use-webui\src\agent\custom_agent.py 中 AgentStepErrorTelemetryEvent 替换成 AgentStepTelemetryEvent ,重新启动即可,如下:

浏览器打开这个链接:http://127.0.0.1:7788

相关推荐
MicrosoftReactor9 小时前
技术速递|以 Token 经济学驱动的架构:混合模型、AI Runway、AKS Kata MicroVM 与 MCP
人工智能·ai·架构·copilot·mcp
蜂蜜黄油呀土豆10 小时前
Agent 循环:观察、思考、行动(ReAct 入门)
python·ai·大模型·react·js
财经资讯数据_灵砚智能10 小时前
基于全球经济类多源新闻的NLP情感分析与数据可视化(夜间-次晨)2026年6月8日
大数据·人工智能·python·ai·信息可视化·自然语言处理·灵砚智能
南知意-10 小时前
MonkeyCode:长亭开源的企业级AI开发平台,GitHub 3.2k Star!
人工智能·ai·开源·github·ai编程·开源项目
luoyanqing11910 小时前
WCS可能用到充备
ai
Direction_Wind10 小时前
大模型常见面试题与生产实践
ai
逆羽飘扬10 小时前
【GPU架构】硬件基础详解
ai
mpr0xy11 小时前
行走编程:把你的 Mac 变成一台随身 AI 开发工作站
人工智能·macos·ai·大语言模型·ai编程·ai写需求
特长腿特长11 小时前
Cherry Studio 通过 MCP 接口操作 Obsidian 完全指南
ai·obsidian·mcp
润乾软件11 小时前
从 GUI 到 LUI 的进化,报表工具也有了 Copilot
人工智能·ai·copilot·报表工具