alibaba/page-agent
GitHub: alibaba/page-agent
纯前端的自然语言网页 GUI 自动化代理,无需浏览器扩展或服务端环境即可运行。
Stars: 1045 | Forks: 98
# Page Agent
[](https://opensource.org/licenses/MIT) [](http://www.typescriptlang.org/) [](https://www.npmjs.com/package/page-agent) [](https://bundlephobia.com/package/page-agent) [](https://github.com/alibaba/page-agent)
居住在您网页中的 GUI Agent。使用自然语言控制 Web 界面。
🌐 **English** | [中文](./docs/README-zh.md)
👉 🚀 Demo | 📖 文档
## ✨ 特性
- **🎯 轻松集成**
- 无需 `browser extension` / `python` / `headless browser`。
- 仅需页面内 JavaScript。一切都在您的网页中发生。
- 这是让您的 Agent 控制网页的最佳工具。
- **📖 基于文本的 DOM 操作**
- 无需截图。无需 OCR 或多模态 LLM。
- 无需特殊权限。
- **🧠 自带 LLM**
- **🎨 精美 UI 且支持人工介入 (Human-in-the-loop)**
- **🐙 可选的 [chrome extension](https://alibaba.github.io/page-agent/docs/features/chrome-extension) 用于多页面任务。**
## 💡 使用案例
- **SaaS AI Copilot** — 用几行代码在您的产品中发布 AI Copilot。无需重写后端。
- **智能表单填写** — 将 20 次点击的工作流转化为一句话。非常适合 ERP、CRM 和管理系统。
- **无障碍访问** — 通过自然语言让任何 Web 应用变得无障碍。支持语音命令、屏幕阅读器,零障碍。
- **多页面 Agent** — 通过可选的 [chrome extension](https://alibaba.github.io/page-agent/docs/features/chrome-extension) 将您的 Agent 扩展到浏览器标签页。
## 🚀 快速开始
### 一行代码集成
使用我们免费的 Demo LLM 体验 PageAgent 的最快方式:
```
```
| 镜像 | URL |
| ------- | ---------------------------------------------------------------------------------- |
| Global | https://cdn.jsdelivr.net/npm/page-agent@1.5.2/dist/iife/page-agent.demo.js |
| China | https://registry.npmmirror.com/page-agent/1.5.2/files/dist/iife/page-agent.demo.js |
### NPM 安装
```
npm install page-agent
```
```
import { PageAgent } from 'page-agent'
const agent = new PageAgent({
model: 'qwen3.5-plus',
baseURL: 'https://dashscope.aliyuncs.com/compatible-mode/v1',
apiKey: 'YOUR_API_KEY',
language: 'en-US',
})
await agent.execute('Click the login button')
```
了解更多编程用法,请参阅 [📖 文档](https://alibaba.github.io/page-agent/docs/introduction/overview)。
## 👏 致谢
本项目建立在 **[`browser-use`](https://github.com/browser-use/browser-use)** 的优秀工作之上。
`PageAgent` 专为 **客户端 Web 增强** 设计,而非服务端自动化。
```
DOM processing components and prompt are derived from browser-use:
Browser Use
Copyright (c) 2024 Gregor Zunic
Licensed under the MIT License
Original browser-use project:
We gratefully acknowledge the browser-use project and its contributors for their
excellent work on web automation and DOM interaction patterns that helped make
this project possible.
Third-party dependencies and their licenses can be found in the package.json
file and in the node_modules directory after installation.
```
## 📄 许可证
[MIT License](LICENSE)
**⭐ 如果您觉得 PageAgent 有用,请给这个仓库点个 Star!**
标签:AI助手, Alibaba, CMS安全, DLL 劫持, DOM操作, GUI Agent, JavaScript, RPA, SaaS AI Copilot, TypeScript, Web Agent, Web自动化, 人机交互, 前端自动化, 大语言模型, 安全插件, 屏幕抓取, 数据可视化, 无头浏览器替代, 浏览器扩展, 浏览器控制, 网页交互, 自动化攻击, 自然语言控制