10倍更快。10倍更少内存。即时启动。 专为 AI 代理、LLM 训练和 Web 自动化设计。
Web 浏览器缺乏 AI 工作负载所需的速度、稳定性和安全性
在云端运行 Chrome 既昂贵又缓慢。
实时自动化不应该等待浏览器。
自动化需要隔离的环境。
从头开始构建,专注于性能和可靠性
不依赖现有浏览器,真正的全新实现。
采用注重性能的低级系统编程语言。
专为无头操作而设计,没有渲染开销。
在 AWS EC2 m5.large 实例上使用 Puppeteer 请求 100 个本地网页的测试结果
无论规模大小,Lightpanda 都能胜任
处理资源密集型的网页抓取任务。
为 AI 代理赋予 Web 能力。
将任何网站转换为程序化接口。
几行代码即可开始使用
import { lightpanda } from '@lightpanda/browser';
import puppeteer from 'puppeteer-core';
const lpdopts = {
host: '127.0.0.1',
port: 9222,
};
const proc = await lightpanda.serve(lpdopts);
const browser = await puppeteer.connect({
browserWSEndpoint: `ws://${lpdopts.host}:${lpdopts.port}`,
});
const page = await browser.newPage();
await page.goto('https://example.com');
// 你的自动化代码...
看看社区怎么说
"说到成本效益,你可能更适合使用专门的云浏览器运行时,比如 @lightpanda_io"
"一个用 Zig 重写的开源无头浏览器,专为 AI 和自动化设计。比 Chrome 少 9 倍内存占用,快 11 倍执行速度。非常令人兴奋。"
"Lightpanda 是一个很酷的项目,刚刚发布了。还有 @steeve ZML!"
"@lightpanda_io 将会改变世界。我敢打赌!!!我不明白为什么没听到更多关于他们浏览器的消息。- CDP 支持 - 大部分功能已支持 - 大部分网站可用 - 内存占用极低 - 速度快得惊人"
"哇,他们用 Zig 写了一个全新的浏览器。github.com/lightpanda-io/..."
"我们在 @amanni_xyz 浏览器中使用 @lightpanda_io 进行无头请求。它目前是基于代理的导航中最快、最高效的解决方案。"
在 10 分钟内设置好你的第一个 Lightpanda 项目
你需要在计算机上安装 Node.js。
mkdir hn-scraper && cd hn-scraper && npm init
npm install --save @lightpanda/browser
# 或者使用 yarn
yarn add @lightpanda/browser
# 或者使用 pnpm
pnpm add @lightpanda/browser
Linux x86_64:
curl -L -o lightpanda https://github.com/lightpanda-io/browser/releases/download/nightly/lightpanda-x86_64-linux && chmod a+x ./lightpanda
MacOS aarch64:
curl -L -o lightpanda https://github.com/lightpanda-io/browser/releases/download/nightly/lightpanda-aarch64-macos && chmod a+x ./lightpanda
Docker:
docker run -d --name lightpanda -p 9222:9222 lightpanda/browser:nightly
创建一个 index.js 文件:
'use strict'
import { lightpanda } from '@lightpanda/browser';
import puppeteer from 'puppeteer-core';
const lpdopts = {
host: '127.0.0.1',
port: 9222,
};
const puppeteeropts = {
browserWSEndpoint: 'ws://' + lpdopts.host + ':' + lpdopts.port,
};
(async () => {
// 启动 Lightpanda 浏览器
const proc = await lightpanda.serve(lpdopts);
// 连接 Puppeteer
const browser = await puppeteer.connect(puppeteeropts);
const context = await browser.createBrowserContext();
const page = await context.newPage();
// 访问页面
await page.goto("https://en.wikipedia.org/wiki/Web_browser");
// 提取链接
const reflist = await page.evaluate(() => {
return Array.from(document.querySelectorAll('.references a.external')).map(row => {
return row.getAttribute('href');
});
});
console.log("所有参考链接", reflist);
// 清理
await page.close();
await context.close();
await browser.disconnect();
proc.kill();
})();
运行脚本:
node index.js
./lightpanda fetch --obey_robots --log_format pretty --log_level info https://demo-browser.lightpanda.io/campfire-commerce/
./lightpanda serve --obey_robots --log_format pretty --log_level info --host 127.0.0.1 --port 9222
LIGHTPANDA_DISABLE_TELEMETRY - 禁用数据收集
export LIGHTPANDA_DISABLE_TELEMETRY=true
./lightpanda serve --host 127.0.0.1 --port 9222
zig build run
# 或者使用 Make
make build
make test
从头开始构建 Web 浏览器是一个巨大的挑战,很少有人尝试过。
我们接受了这个挑战,因为自动化和 AI 需要一个新的基础,而不是对旧技术栈的包装。
在我们之前的公司,我们每天抓取数百万网页,花了数年时间忍受使用 Chrome 扩展爬虫基础设施的痛苦。 我们知道唯一的真正解决方案是重新开始。
Lightpanda 在这里改变游戏规则。我们希望让开发者和企业能够用更少的资源做更多的事情。