部署 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

相关推荐
非专业程序员Ping1 小时前
Vibe Coding 实战!花了两天时间,让 AI 写了一个富文本渲染引擎!
ios·ai·swift·claude·vibecoding
紫小米4 小时前
提示词(Prompt)工程与推理优化
人工智能·ai·prompt·ai agent
陈果然DeepVersion5 小时前
Java大厂面试真题:从Spring Boot到AI微服务的三轮技术拷问(二)
spring boot·redis·spring cloud·微服务·ai·java面试·rag
hello kitty w7 小时前
[6]. SpringAI Alibaba 向量化和向量数据库
ai
伟大的大威10 小时前
LLM + TFLite 搭建离线中文语音指令 NLU并部署到 Android 设备端
python·ai·nlu
程序员小赵同学10 小时前
Spring AI Alibaba文生图实战:从零开始编写AI图片生成Demo
阿里云·ai·springboot·springai
哥布林学者14 小时前
吴恩达深度学习课程二: 改善深层神经网络 第二周:优化算法(五)Adam 优化算法
深度学习·ai
hxj..15 小时前
如何进行AI作图(架构图,流程图等)
人工智能·ai·ai作画
todoitbo15 小时前
使用n8n搭建服务器监控系统:从Webhook到Telegram告警的完整实现
运维·服务器·数据库·ai·向量数据库·流处理·n8n
CoderJia程序员甲15 小时前
GitHub 热榜项目 - 日榜(2025-11-11)
ai·开源·大模型·github·ai教程