Bun 环境存在 Playwright bug,需用 Node.js 运行;必须先单独安装 Playwright 及 Chromium 浏览器;需在 .env 中自行填入 OPENAI_API_KEY 等模型密钥。
browsernode
lennybaseMIT长期未更新让 AI 智能体直接操作浏览器完成网页任务,基于 Playwright 封装,省去自己搭自动化流程的麻烦。
🌐 Make websites accessible for AI agents. Automate tasks online with ease.
npm install browsernode
npm init playwright@latest
playwright install chromium
mv .env.example .envREADME 未说明显存或 GPU 要求,仅要求 Node.js v20.19.4 或更高版本;浏览器由 Playwright 驱动,需安装 Chromium。
Browser-use 的 TypeScript 实现,让 AI Agent 直接操控浏览器完成网页任务
让 AI 智能体直接操作浏览器完成网页任务,基于 Playwright 封装,省去自己搭自动化流程的麻烦。
核心能力
- 兼容 Browser-use 全部 API 与功能
- 用 Agent 类接收任务和 LLM 实例并执行
- 内置 ChatOpenAI 等 LLM 接入模块
- 提供 Gradio UI 与交互式 CLI 调试
- 支持自定义函数扩展 Agent 动作
容易踩的坑
暂无 release 数据(可能没有发版,或尚未同步)。
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
🌐 Browsernode is the easiest way to connect your AI agents with the browser. ✅ Browsernode is compatible with all of Browser-use APIs and features.
Quick start
with Node.js (v20.19.4 or higher) and npm
❌ Bun environment , has a Playwright bug.
npm install browsernode
Install Playwright: Installation | Playwright
npm init playwright@latest
playwright install chromium
Add your API keys for the provider you want to use to your .env file.
mv .env.example .env
OPENAI_API_KEY=
For other settings, models, and more, check out the documentation 📕.
Spin up your agent:
Commonjs style
const { Agent } = require("browsernode");
const { ChatOpenAI } = require("browsernode/llm");
(async () => {
const llm = new ChatOpenAI({
model: "gpt-4.1",
temperature: 0.0,
apiKey: process.env.OPENAI_API_KEY,
});
const task = "Search for the latest tesla stock price";
const agent = new Agent({
task,
llm,
});
const history = await agent.run();
console.log(history.usage);
})();
ESM style
package.json
{
// ... other properties
"type": "module"
// ... other properties
}
import { Agent } from "browsernode";
import { ChatOpenAI } from "browsernode/llm";
const llm = new ChatOpenAI({
model: "gpt-4.1",
temperature: 0.0,
apiKey: process.env.OPENAI_API_KEY,
});
const task = "Search for the latest tesla stock price";
const agent = new Agent({
task: task,
llm: llm,
});
agent.run();
run
npx tsx quickstart.ts
Test with UI
You can test browsernode using gadio_demo
Test with an interactive CLI
You can also use our browsernode-cli
Demos
Task:look up the world's most valuable companies, save top 5 companies and their value to companies.txt.
output: companies.txt
1. Microsoft: $3.530 T
2. NVIDIA: $3.462 T
3. Apple: $2.934 T
4. Amazon: $2.251 T
5. Alphabet (Google): $2.125 T
Task:Write a letter in Google Docs to my Papa, thanking him for everything, and save the document as a PDF.
Task:go to https://en.wikipedia.org/wiki/Banana and click on buttons on the wikipedia page to go as fast as possible from banna to Quantum mechanics
result:
// ... previous actions
🛠️ Action 1/1: {
"clickElement": {
"index": 41
}
}
// ... more actions
🛠️ Action 1/1: {
"done": {
"success": false,
"text": "I navigated through the Banana Wikipedia page, reaching the section on Fusarium wilt TR4. However, I did not complete the task of reaching Quantum mechanics."
}
}
// ... final result
📄 Result: I navigated through the Banana Wikipedia page, reaching the section on Fusarium wilt TR4. However, I did not complete the task of reaching Quantum mechanics.
More examples
For more examples see the examples folder
Contributing
We love contributions! Feel free to open issues for bugs or feature requests. To contribute to the docs, check out the /docs folder.