lightpanda-io/browser:用Zig语言从零打造的新型无头浏览器,专为AI自动化而生

lightpanda-io/browser(https://github.com/lightpanda-io/browser)是从零用Zig语言全新编写的浏览器,专为AI Agent和自动化场景设计。不是Chromium fork,不是WebKit补丁——是全新从头构建的浏览器。

惊人性能

官方基准测试(933个真实网页):

内存峰值:Lightpanda 123MB vs Headless Chrome 2GB(减少约16倍)

执行时间:Lightpanda 5秒 vs Headless Chrome 46秒(快约9倍)

这对大规模网页抓取和AI自动化任务意义重大。

技术特点

Lightpanda用Zig语言编写,Zig是注重性能和内存安全的系统级语言,没有垃圾回收,长期运行内存非常稳定。完整支持现代Web标准(JavaScript执行、CSS渲染、DOM操作等),提供简洁HTTP API和CLI工具。

安装方法

# 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 ARM64
curl -L -o lightpanda https://github.com/lightpanda-io/browser/releases/download/nightly/lightpanda-aarch64-macos
chmod a+x ./lightpanda

# 启动服务
./lightpanda serve --port 9222

基本使用

# 导航网页
curl -X POST http://localhost:9222/api/navigate -d '{"url":"https://github.com"}'

# 截图
curl -X POST http://localhost:9222/api/screenshot -o screenshot.png

# 执行JavaScript
curl -X POST http://localhost:9222/api/evaluate -d '{"script":"document.title"}'

# 点击元素
curl -X POST http://localhost:9222/api/click -d '{"selector":"button.signup"}'

适用场景

Lightpanda特别适合:大规模网页抓取、AI Agent网页操作、长时间运行的自动化脚本、资源受限的服务器环境、CI/CD环境中的浏览器测试。比Chromium轻量得多,非常适合容器化环境部署。

开源协议

采用MIT开源协议。


服务支持:如有兴趣不会搭建,可以联系微信:WRYD6166,开源项目搭建10-50元。

© 版权声明
THE END
喜欢就支持一下吧
点赞15 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容