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

​一、软件介绍

文末提供程序和源码下载

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.mzph.cn/web/79917.shtml

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

相关文章

团结引擎开源车模 Sample 发布:光照渲染优化 动态交互全面体验升级

光照、材质与交互效果的精细控制&#xff0c;通常意味着复杂的技术挑战&#xff0c;但借助 Shader Graph 14.1.0(已内置在团结引擎官方 1.5.0 版本中)&#xff0c;这一切都变得简单易用。通过最新团结引擎官方车模 Sample&#xff0c;开发者能切身感受到全新光照优化与编辑功能…

SpringCloud之Ribbon基础认识-服务负载均衡

0、Ribbon基本认识 Spring Cloud Ribbon 是基于 Netflix Ribbon 实现的一套客户端 负载均衡的工具。 Ribbon 主要功能是提供客户端负载均衡算法和服务调用 Ribbon 客户端组件提供一系列完善的配置项如连接超时&#xff0c;重试等。 Ribbon 会基于某种规则&#xff08;如简单…

当 DeepSeek 遇见区块链:一场颠覆式的应用革命

目录 一、DeepSeek 与区块链的初印象二、技术融合&#xff1a;创新的基石2.1 强化学习优化智能合约2.2 混合专家系统适配多链2.3 语义理解增强合规性 三、应用实践&#xff1a;重塑行业格局3.1 DeFi 协议智能化跃迁3.2 GameFi 经济深度进化3.3 供应链金融信任增强 四、面临挑战…

vue3项目中使用CodeMirror组件的详细教程,中文帮助文档,使用手册

简介 这是基于 Vue 3 开发的 CodeMirror 组件。该组件基于 CodeMirror 5 开发&#xff0c;仅支持 Vue 3。 除了支持官方提供的各种语法模式外&#xff0c;还额外添加了日志输出展示模式&#xff0c;开箱即用&#xff0c;但不一定适用于所有场景。 如需完整文档和更多使用案例…

LeetCode热题100--240.搜索二维矩阵--中等

1. 题目 编写一个高效的算法来搜索 m x n 矩阵 matrix 中的一个目标值 target 。该矩阵具有以下特性&#xff1a; 每行的元素从左到右升序排列。 每列的元素从上到下升序排列。 示例 1&#xff1a; 输入&#xff1a;matrix [[1,4,7,11,15],[2,5,8,12,19],[3,6,9,16,22],[1…

2025爬虫实战技巧:高效数据采集方案

2025爬虫实战技巧:高效数据采集方案 🔥 本文核心价值 HTTPS请求链路加密逆向解析动态Cookie生成机制破解Cloudflare等高级防护绕过方案分布式爬虫架构设计要点目录 2025爬虫实战技巧:高效数据采集方案🔥 本文核心价值一、现代反爬机制技术解析1.1 主流平台防护体系1.2 反…

绑定 SSH key(macos)

在 macOS 上绑定 Gitee 或 GitHub 的 SSH Key&#xff0c;通常分为以下几步操作&#xff0c;包括生成 SSH key、添加到 ssh-agent&#xff0c;并配置到 Gitee 或 GitHub 平台。 1. 检查是否已有 SSH Key ls -al ~/.ssh 看看是否已有 id_rsa 或 id_ed25519 等文件。如果没有就…

Tailwind CSS v4 主题化实践入门(自定义 Theme + 主题模式切换)✨

ok&#xff0c;经过学习Tailwindcss我决定将此专栏建设成为一个Tailwindcss实战专栏&#xff0c;我将在专栏内完成5050挑战&#xff1a;50天50个Tailwindcss练习项目&#xff0c;欢迎大家订阅&#xff01;&#xff01;&#xff01; Tailwind CSS v4 带来了更强大的主题定制能力…

SAF利用由Varjo和AFormX开发的VR/XR模拟器推动作战训练

通过将AFormX的先进军用飞行模拟器与Varjo的行业领先的VR/XR硬件相结合&#xff0c;斯洛文尼亚武装部队正以经济高效、沉浸式的训练方式培训战斗机飞行员&#xff0c;以提高其战术准备和作战效率。 挑战&#xff1a;获得战术军事航空训练的机会有限 军事航空训练长期以来一直…

VUE中通过DOM导出PDF

最终效果 前端导出PDF的核心在于样式的绘制上&#xff0c;这里其实直接使用CSS进行绘制和布局就行&#xff0c;只不过需要计算好每页DIV盒子的大小&#xff0c;防止一页放不下造成样式错乱。 项目依赖 项目是Vue3 TS npm i html2canvas1.4.1 npm i jspdf3.0.1工具类(htmlToPdf…

SpringAI框架中的RAG模块详解及应用示例

SpringAI框架中的RAG模块详解及应用示例 RAG&#xff08;Retrieval-Augmented Generation&#xff09;可以通过检索知识库&#xff0c;克服大模型训练完成后参数冻结的局限性&#xff0c;携带知识让大模型根据知识进行回答。SpringAI框架提供了模块化的API来支持RAG&#xff0…

MySQL-数据查询(测试)-05-(12-1)

1-数据准备&#xff1a; CREATE TABLE 员工信息表 (员工编号 VARCHAR(10) PRIMARY KEY,姓名 VARCHAR(20),学历 VARCHAR(20),出生日期 DATE,性别 INT,工作年限 INT,地址 VARCHAR(100),电话号码 VARCHAR(20),员工部门号 INT ); INSERT INTO 员工信息表 (员工编号, 姓名, 学历, 出…

5G网络:能源管理的“智能电网“革命,Python如何成为关键推手?

5G网络:能源管理的"智能电网"革命,Python如何成为关键推手? 大家好,我是Echo_Wish。今天咱们聊一个既硬核又接地气的话题——5G网络如何用Python代码重构全球能源管理。 不知道你们有没有注意过: • 家里装了智能电表后,电费突然变"聪明"了,谷时充…

AI背景下,如何重构你的产品?

当AI敲门时&#xff0c;你的产品准备好开门了吗&#xff1f; 最近和做产品的老张聊天&#xff0c;他愁眉苦脸地说&#xff1a;"现在AI这么火&#xff0c;我们的产品就像个老古董&#xff0c;用户都跑隔壁用AI产品去了。“这话让我想起三年前另一个朋友&#xff0c;当时区…

互联网大厂Java面试实战:从Spring Boot到微服务的技术问答与解析

&#x1f4aa;&#x1f3fb; 1. Python基础专栏&#xff0c;基础知识一网打尽&#xff0c;9.9元买不了吃亏&#xff0c;买不了上当。 Python从入门到精通 &#x1f601; 2. 毕业设计专栏&#xff0c;毕业季咱们不慌忙&#xff0c;几百款毕业设计等你选。 ❤️ 3. Python爬虫专栏…

Apollo学习——aem问题

执行aem指令出现一下问题 lxflxf:~/MYFile/apollo_v10.0 $aem enter permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.49/containers/json?filters%7B%22name%22%…

数字IC后端零基础入门基础理论(Day2)

数字IC后端零基础入门基础理论&#xff08;Day1&#xff09; Placement Blockage: cell摆放阻挡层。它是用来引导工具做placement的一种物理约束或手段&#xff0c;目的是希望工具按照我们的要求来做标准单元的摆放。 它主要有三种类型&#xff0c;分别是hard placement bloc…

如何远程执行脚本不留痕迹

通常我们在做远程维护的时候&#xff0c;会有这么一个需求&#xff0c;就是我想在远程主机执行一个脚本&#xff0c;但是这个脚本我又不想保留在远程主机上&#xff0c;那么有人就说了&#xff0c;那就复制过去再登录远程执行不就行了吗&#xff1f;嗯嗯&#xff0c;但是这还不…

【Lua】java 调用redis执行 lua脚本

【Lua】java 调用redis执行 lua脚本 public Object executeLuaScript(String script, List<String> keys, Object... args) {// 注意: 这里 Long.class 是返回值类型, 一定要指定清楚 不然会报错return this.redisTemplate.execute(RedisScript.of(j脚本, Long.class), k…

利用混合磁共振成像 - 显微镜纤维束成像技术描绘结构连接组|文献速递-深度学习医疗AI最新文献

Title 题目 Imaging the structural connectome with hybrid MRI-microscopy tractography 利用混合磁共振成像 - 显微镜纤维束成像技术描绘结构连接组 01 文献速递介绍 通过多种模态绘制大脑结构能够增进我们对大脑功能、发育、衰老以及疾病的理解&#xff08;汉森等人&am…