Lightpanda开源浏览器:专为 AI 和自动化而设计的无界面浏览器

news2025/5/16 11:36:23

​一、软件介绍

文末提供程序和源码下载

Lightpanda开源浏览器:专为 AI 和自动化而设计的无界面浏览器;

  • Javascript execution Javascript 执行
  • Support of Web APIs (partial, WIP)
  • 支持 Web API(部分、WIP)
  • Compatible with Playwright, Puppeteer through CDP (WIP)
  • 通过 CDP (WIP) 与 Playwright、Puppeteer 兼容

Fast web automation for AI agents, LLM training, scraping and testing:
用于 AI 代理、LLM训练、抓取和测试的快速 Web 自动化:

  • Ultra-low memory footprint (9x less than Chrome)
  • 超低内存占用(比 Chrome 少 9 倍)
  • Exceptionally fast execution (11x faster than Chrome)
  • 极快的执行速度(比 Chrome 快 11 倍)
  • Instant startup 即时启动

二、Quick start 快速开始

Install from the nightly builds
从 nightly 版本安装
You can download the last binary from the nightly builds for Linux x86_64 and MacOS aarch64.
您可以从 Linux x86_64 和 MacOS aarch64 的夜间版本中下载最后一个二进制文件。

For Linux 对于 Linux

curl -L -o lightpanda https://github.com/lightpanda-io/browser/releases/download/nightly/lightpanda-x86_64-linux && \
chmod a+x ./lightpanda
For MacOS 对于 MacOS

curl -L -o lightpanda https://github.com/lightpanda-io/browser/releases/download/nightly/lightpanda-aarch64-macos && \
chmod a+x ./lightpanda
For Windows + WSL2 对于 Windows + WSL2

The Lightpanda browser is compatible to run on windows inside WSL. Follow the Linux instruction for installation from a WSL terminal. It is recommended to install clients like Puppeteer on the Windows host.
Lightpanda 浏览器兼容在 WSL 内的 Windows 上运行。按照 Linux 说明从 WSL 终端进行安装。建议在 Windows 主机上安装像 Puppeteer 这样的客户端。

Dump a URL 转储 URL
./lightpanda fetch --dump https://lightpanda.io
info(browser): GET https://lightpanda.io/ http.Status.ok
info(browser): fetch script https://api.website.lightpanda.io/js/script.js: http.Status.ok
info(browser): eval remote https://api.website.lightpanda.io/js/script.js: TypeError: Cannot read properties of undefined (reading 'pushState')
<!DOCTYPE html>
Start a CDP server 启动 CDP 服务器
./lightpanda serve --host 127.0.0.1 --port 9222
info(websocket): starting blocking worker to listen on 127.0.0.1:9222
info(server): accepting new conn...
Once the CDP server started, you can run a Puppeteer script by configuring the browserWSEndpoint.
CDP 服务器启动后,您可以通过配置 browserWSEndpoint .

'use strict'

import puppeteer from 'puppeteer-core';

// use browserWSEndpoint to pass the Lightpanda's CDP server address.
const browser = await puppeteer.connect({
  browserWSEndpoint: "ws://127.0.0.1:9222",
});

// The rest of your script remains the same.
const context = await browser.createBrowserContext();
const page = await context.newPage();

// Dump all the links from the page.
await page.goto('https://wikipedia.com/');

const links = await page.evaluate(() => {
  return Array.from(document.querySelectorAll('a')).map(row => {
    return row.getAttribute('href');
  });
});

console.log(links);

await page.close();
await context.close();
await browser.disconnect();
Telemetry 遥测
By default, Lightpanda collects and sends usage telemetry. This can be disabled by setting an environment variable LIGHTPANDA_DISABLE_TELEMETRY=true. You can read Lightpanda's privacy policy at: https://lightpanda.io/privacy-policy.
默认情况下,Lightpanda 收集和发送使用情况遥测数据。这可以通过设置 environment variable LIGHTPANDA_DISABLE_TELEMETRY=true 来禁用。您可以在以下网址阅读 Lightpanda 的隐私政策:https://lightpanda.io/privacy-policy。

三、Build from sources 从源构建

Prerequisites 先决条件
Lightpanda is written with Zig 0.14.0. You have to install it with the right version in order to build the project.
Lightpanda 是用 Zig 0.14.0 编写的。您必须使用正确的版本安装它才能构建项目。

Lightpanda also depends on zig-js-runtime (with v8), Netsurf libs and Mimalloc.
Lightpanda 还依赖于 zig-js-runtime(v8)、Netsurf 库和 Mimalloc。

To be able to build the v8 engine for zig-js-runtime, you have to install some libs:
为了能够为 zig-js-runtime 构建 v8 引擎,您必须安装一些库:

For Debian/Ubuntu based Linux:
对于基于 Debian/Ubuntu 的 Linux:

sudo apt install xz-utils \
    python3 ca-certificates git \
    pkg-config libglib2.0-dev \
    gperf libexpat1-dev \
    cmake clang
For systems with Nix, you can use the devShell:
对于带有 Nix 的系统,你可以使用 devShell:

nix develop
For MacOS, you only need cmake:
对于 MacOS,你只需要 cmake:

brew install cmake
Install and build dependencies
安装和构建依赖项
All in one build 多合一构建
You can run make install to install deps all in one (or make install-dev if you need the development versions).
您可以运行 make install 以将 deps 全部安装在一个 (或者 make install-dev 如果您需要开发版本)。

Be aware that the build task is very long and cpu consuming, as you will build from sources all dependencies, including the v8 Javascript engine.
请注意,构建任务非常长且占用大量 CPU,因为您将从源构建所有依赖项,包括 v8 Javascript 引擎。

Step by step build dependency
逐步构建依赖项
The project uses git submodules for dependencies.
该项目使用 git submodules 作为依赖项。

To init or update the submodules in the vendor/ directory:
要初始化或更新目录中的 vendor/ 子模块,请执行以下作:

make install-submodule
iconv 图标

libiconv is an internationalization library used by Netsurf.
libiconv 是 Netsurf 使用的国际化库。

make install-libiconv
Netsurf libs Netsurf 库

Netsurf libs are used for HTML parsing and DOM tree generation.
Netsurf 库用于 HTML 解析和 DOM 树生成。

make install-netsurf
For dev env, use make install-netsurf-dev.
对于 dev env,请使用 make install-netsurf-dev .

Mimalloc

Mimalloc is used as a C memory allocator.
Mimalloc 用作 C 内存分配器。

make install-mimalloc
For dev env, use make install-mimalloc-dev.
对于 dev env,请使用 make install-mimalloc-dev .

Note: when Mimalloc is built in dev mode, you can dump memory stats with the env var MIMALLOC_SHOW_STATS=1. See https://microsoft.github.io/mimalloc/environment.html.
注意:当 Mimalloc 在 dev 模式下构建时,您可以使用 env var 转储内存统计信息 MIMALLOC_SHOW_STATS=1 。请参阅 https://microsoft.github.io/mimalloc/environment.html。

v8

First, get the tools necessary for building V8, as well as the V8 source code:
首先,获取构建 V8 所需的工具以及 V8 源代码:

make get-v8
Next, build v8. This build task is very long and cpu consuming, as you will build v8 from sources.
接下来,构建 v8。此构建任务非常长且占用 CPU,因为您将从源代码构建 v8。

make build-v8
For dev env, use make build-v8-dev.
对于 dev env,请使用 make build-v8-dev .

四、Test 测试

Unit Tests 单元测试
You can test Lightpanda by running make test.
您可以通过运行 make test 来测试 Lightpanda。

End to end tests 端到端测试
To run end to end tests, you need to clone the demo repository into ../demo dir.
要运行端到端测试,您需要将 demo 存储库克隆到 dir 中 ../demo 。

You have to install the demo's node requirements
您必须安装 demo 的 node 要求

You also need to install Go > v1.24.
您还需要安装 Go > v1.24。

make end2end
Web Platform Tests Web 平台测试
Lightpanda is tested against the standardized Web Platform Tests.
Lightpanda 已针对标准化 Web 平台测试进行了测试。

The relevant tests cases are committed in a dedicated repository which is fetched by the make install-submodule command.
相关测试用例提交到由 make install-submodule 命令获取的专用存储库中。

All the tests cases executed are located in the tests/wpt sub-directory.
执行的所有测试用例都位于 tests/wpt 子目录中。

For reference, you can easily execute a WPT test case with your browser via wpt.live.
作为参考,您可以通过 wpt.live 使用浏览器轻松执行 WPT 测试用例。

Run WPT test suite 运行 WPT 测试套件
To run all the tests:
要运行所有测试,请执行以下作:

make wpt
Or one specific test:
或一个特定的测试:

make wpt Node-childNodes.html
Add a new WPT test case
添加新的 WPT 测试用例
We add new relevant tests cases files when we implemented changes in Lightpanda.
当我们在 Lightpanda 中实施更改时,我们会添加新的相关测试用例文件。

To add a new test, copy the file you want from the WPT repo into the tests/wpt directory.
要添加新测试,请将所需的文件从 WPT 存储库复制到该 tests/wpt 目录中。

⚠️ Please keep the original directory tree structure of tests/wpt.
⚠️ 请保留 tests/wpt 的原始目录树结构。

五、软件下载

夸克网盘分享

本文信息来源于GitHub作者地址:GitHub - lightpanda-io/browser: Lightpanda: the headless browser designed for AI and automation

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2376813.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

技术文档不完善,如何促进知识传承

建立统一的技术文档规范、引入文档自动化工具、将文档写作融入开发流程、建设团队知识共享文化 是促进知识传承的关键策略。在其中&#xff0c;尤应重视建立统一的技术文档规范&#xff0c;通过标准化文档结构、命名、版本管理等方式&#xff0c;提升文档质量和可维护性&#x…

Windows平台OpenManus部署及WebUI远程访问实现

前言&#xff1a;继DeepSeek引发行业震动后&#xff0c;Monica.im团队最新推出的Manus AI 产品正席卷科技圈。这款具备自主思维能力的全能型AI代理&#xff0c;不仅能精准解析复杂指令并直接产出成果&#xff0c;更颠覆了传统人机交互模式。尽管目前仍处于封闭测试阶段&#xf…

位运算题目:找到最接近目标值的函数值

文章目录 题目标题和出处难度题目描述要求示例数据范围 解法思路和算法代码复杂度分析 题目 标题和出处 标题&#xff1a;找到最接近目标值的函数值 出处&#xff1a;1521. 找到最接近目标值的函数值 难度 8 级 题目描述 要求 Winston 构造了一个如上所示的函数 func \…

哲学物理:太极图和莫比乌斯环有什么关系?

太极图 是中国传统文化中的经典符号,由阴阳两部分组成,黑白两色相互环绕,中间有两点表示阴中有阳,阳中有阴。太极图象征着对立统一、相互依存和动态平衡,是道家哲学的核心思想之一。 ![在这里插入图片描述](https://i-blog.csdnimg.cn/direct/477e67d70c2b4383bac3e12c8a6…

机器学习笔记1

一、 机器学习介绍与定义 1. 机器学习定义 机器学习&#xff08;Machine Learning&#xff09;本质上就是让计算机自己在数据中学习规律&#xff0c;并根据所得到的规律对未来数据进行预测。 机器学习包括如聚类、分类、决策树、贝叶斯、神经网络、深度学习&#xff08;Deep…

JVM中的安全点是什么,作用又是什么?

JVM中的安全点&#xff08;Safepoint&#xff09; 是Java虚拟机设计中的一个关键机制&#xff0c;主要用于协调所有线程的执行状态&#xff0c;以便进行全局操作&#xff08;如垃圾回收、代码反优化等&#xff09;。它的核心目标是确保在需要暂停所有线程时&#xff0c;每个线程…

关于github使用总结

文章目录 一、本地使用git&#xff08;一&#xff09;创建一个新的本地Git库首先在本地创建一个新的git仓库然后进行一次初始提交提交过后就可以查看提交记录 &#xff08;二&#xff09;在本地仓库进行版本恢复先执行 git log 查看项目提交历史使用 git checkout 恢复版本 二、…

2024年9月电子学会等级考试五级第三题——整数分解

题目 3、整数分解 正整数 N 的 K-P 分解是指将 N 写成 K 个正整数的 P 次方的和。本题就请你对任意给定的正整数 N、K、P&#xff0c;写出 N 的 K-P 分解。 时间限制&#xff1a;8000 内存限制&#xff1a;262144 输入 输入在一行给出 3 个正整数 N (≤ 400)、K (≤ N)、P (1 …

毕设设计 | 管理系统图例

文章目录 环素1. 登录、注册2. 菜单管理 环素 1. 登录、注册 2. 菜单管理 公告通知 订单管理 会员管理 奖品管理 新增、编辑模块

什么情况会导致JVM退出?

大家好&#xff0c;我是锋哥。今天分享关于【什么情况会导致JVM退出&#xff1f;】面试题。希望对大家有帮助&#xff1b; 什么情况会导致JVM退出&#xff1f; 1000道 互联网大厂Java工程师 精选面试题-Java资源分享网 JVM&#xff08;Java虚拟机&#xff09;退出的情况通常是…

实验6 电子邮件

实验6 电子邮件 1、实验目的 理解电子邮件系统基本结构 理解客户端和服务器端&#xff0c;以及服务器之间的通信 分析理解SMTP&#xff0c;POP3协议 2、实验环境 硬件要求&#xff1a;阿里云云主机ECS 一台。 软件要求&#xff1a;Linux/ Windows 操作系统 3、实验内容…

深入理解浏览器渲染引擎:底层机制与性能优化实战

现代浏览器背后是一个庞大而复杂的系统工程&#xff0c;渲染引擎作为核心模块之一&#xff0c;承担着从解析 HTML/CSS 到最终绘制页面的关键职责。本文将从底层机制出发&#xff0c;系统梳理渲染引擎&#xff08;如 Blink&#xff09;工作原理、V8 与渲染流程的协作方式&#x…

大模型浪潮下,黑芝麻智能高性能芯片助力汽车辅助驾驶变革

在全球汽车产业向智能化、网联化加速转型的浪潮中&#xff0c;大模型技术的崛起为汽车领域带来了前所未有的变革机遇。黑芝麻智能在高性能芯片和基础软件架构领域的持续创新&#xff0c;正全力推动汽车智能化的发展&#xff0c;为行业注入新的活力。 大模型全面助力辅助驾驶迈…

康谋分享 | 自动驾驶仿真进入“标准时代”:aiSim全面对接ASAM OpenX

目录 一、OpenDRIVE&#xff1a;兼容多版本地图标准 &#xff08;1&#xff09;Atlas 工作流 &#xff08;2&#xff09;UE Plugin 工作流 二、OpenSCENARIO&#xff1a;标准化动态行为建模 三、OpenCRG&#xff1a;还原毫米级路面细节 四、OpenMATERIAL&#xff1a;更真…

GPUGeek云平台实战:DeepSeek-R1-70B大语言模型一站式部署

随着人工智能技术的迅猛发展&#xff0c;特别是在自然语言处理领域&#xff0c;大型语言模型如DeepSeek-R1-70B的出现&#xff0c;推动了各行各业的变革。为了应对这些庞大模型的计算需求&#xff0c;云计算平台的普及成为了关键&#xff0c;特别是基于GPU加速的云平台&#xf…

【C语言】初阶数据结构相关习题(二)

&#x1f386;个人主页&#xff1a;夜晚中的人海 今日语录&#xff1a;知识是从刻苦劳动中得来的&#xff0c;任何成就都是刻苦劳动的结果。——宋庆龄 文章目录 &#x1f384;一、链表内指定区间翻转&#x1f389;二、从链表中删去总和值为零的节点&#x1f680;三、链表求和&…

嵌入式学习--江科大51单片机day7

我们在听课的过程中&#xff0c;可能对老师讲的有疑问&#xff0c;或者有些自己的理解&#xff0c;我们可以去问豆包&#xff0c;包括在写博客的时候我也是&#xff0c;不断去问豆包保证思考的正确性。&#xff08;有人感觉豆包很low啊&#xff0c;其实这些基础性的东西豆包一般…

Element Plus 取消el-form-item点击触发组件,改为原生表单控件

文章目录 问题&#xff1a;方法一&#xff1a;使用全局样式覆盖&#xff08;推荐&#xff09;方法二&#xff1a;自定义指令&#xff08;更灵活&#xff09;方法三&#xff1a;封装高阶组件方法四&#xff1a;运行时DOM修改&#xff08;不推荐&#xff09; 问题&#xff1a; 描…

Git-学习笔记(粗略版)

前言 很多人都听过git&#xff0c;github这些名词,但是它们是什么&#xff0c;怎么使用&#xff1f;git和github是一个东西吗&#xff1f;本文将详细解答这些问题&#xff0c;彻底弄懂git。 1.Git是啥❓ 有一天&#xff0c;我们的插画师小王接到一个绘画订单&#xff0c;但奈…

专项智能练习(定义判断)

1. 单选题 热传导是介质内无宏观运动时的传热现象&#xff0c;其在固体、液体和气体中均可发生。但严格而言&#xff0c;只有在固体中才是纯粹的热传导&#xff0c;在流体&#xff08;泛指液体和气体&#xff09;中又是另外一种情况&#xff0c;流体即使处于静止状态&#xff…