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

相关推荐
小雨青年4 小时前
MateChat 进阶实战:打造零后端、隐私安全的“端侧记忆”智能体
前端·华为·ai·华为云·状态模式
paopao_wu6 小时前
腾讯HunyuanOCR开源端到端OCR-1B:本地部署与测试
ai·开源·ocr·hunyuan
带刺的坐椅8 小时前
Solon AI 开发学习10 - chat - 工具调用概念介绍
ai·llm·solon·tool-call
蓝耘智算10 小时前
如何选择合适的GPU算力服务商?企业AI算力采购指南
ai·gpu算力·蓝耘
蓝耘智算11 小时前
蓝耘元生代GPU算力调度云平台深度解析:高性价比算力云与GPU算力租赁首选方案
人工智能·ai·gpu算力·蓝耘
阿猿收手吧!11 小时前
【大模型】什么是大模型?vLLM是?模型部署?CUDA?
ai·llama
阿杰学AI11 小时前
AI核心知识19——大语言模型之SFT(简洁且通俗易懂版)
人工智能·ai·语言模型·aigc·监督微调
哥布林学者11 小时前
吴恩达深度学习课程三: 结构化机器学习项目 第二周:误差分析与学习方法(四)多任务学习
深度学习·ai
i查拉图斯特拉如是12 小时前
搭建本地大模型知识库
人工智能·ai·大模型·知识库·ollama
组合缺一12 小时前
Solon AI 开发学习11 - chat - 工具调用与定制(Tool Call)
人工智能·学习·ai·chatgpt·llm·solon·toolcall