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.pswp.cn/web/79917.shtml
繁體地址,請注明出處:http://hk.pswp.cn/web/79917.shtml
英文地址,請注明出處:http://en.pswp.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…