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

相关推荐
智算菩萨6 分钟前
ChatGPT在非洲主要国家教育中的应用:效益、接受度与伦理挑战——基于2022-2024年文献的系统综述精读
论文阅读·人工智能·gpt·深度学习·ai·chatgpt·论文笔记
彭于晏Yan18 分钟前
Spring AI(一):玩转AI大模型
spring boot·后端·ai
CoderJia程序员甲22 分钟前
GitHub 热榜项目 - 日榜(2026-03-21)
人工智能·ai·大模型·github·ai教程
前端摸鱼匠33 分钟前
面试题6:因果掩码(Causal Mask)在Decoder中的作用是什么?训练、推理阶段如何使用?
人工智能·ai·语言模型·自然语言处理·面试
前端摸鱼匠38 分钟前
面试题7:Encoder-only、Decoder-only、Encoder-Decoder三种架构的差异与适用场景?
人工智能·深度学习·ai·面试·职场和发展·架构·transformer
智算菩萨3 小时前
【Generative AI For Autonomous Driving】4 自动驾驶生成式模型前沿实战——从图像合成到多模态大模型的技术全景解析
论文阅读·人工智能·深度学习·机器学习·ai·自动驾驶
人工智能AI酱10 小时前
【AI深究】逻辑回归(Logistic Regression)全网最详细全流程详解与案例(附大量Python代码演示)| 数学原理、案例流程、代码演示及结果解读 | 决策边界、正则化、优缺点及工程建议
人工智能·python·算法·机器学习·ai·逻辑回归·正则化
智算菩萨10 小时前
【How Far Are We From AGI】3 AGI的边界扩张——数字、物理与智能三重接口的技术实现与伦理困境
论文阅读·人工智能·深度学习·ai·agi
智算菩萨10 小时前
【How Far Are We From AGI】2 大模型的“灵魂“缺口:当感知、记忆与自我意识的迷雾尚未散去
人工智能·ai·agi·感知
qq_4523962311 小时前
【Python × AI】多智能体协作:从 AutoGPT 到 CrewAI 的组织进化论
大数据·人工智能·python·ai