lightpanda-browser
AIエージェント向けに最適化された軽量ブラウザで、ウェブスクレイピングやタスク自動化を効率的に行い、リソースが限られた環境でもヘッドレスブラウジングを実現するSkill。
📜 元の英語説明(参考)
Use Lightpanda headless browser optimized for AI agents — fast, lightweight, designed for web scraping and automation at scale. Use when: building AI web scrapers, automating web tasks with agents, running headless browsing in resource-constrained environments.
🇯🇵 日本人クリエイター向け解説
AIエージェント向けに最適化された軽量ブラウザで、ウェブスクレイピングやタスク自動化を効率的に行い、リソースが限られた環境でもヘッドレスブラウジングを実現するSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o lightpanda-browser.zip https://jpskill.com/download/15071.zip && unzip -o lightpanda-browser.zip && rm lightpanda-browser.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/15071.zip -OutFile "$d\lightpanda-browser.zip"; Expand-Archive "$d\lightpanda-browser.zip" -DestinationPath $d -Force; ri "$d\lightpanda-browser.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
lightpanda-browser.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
lightpanda-browserフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
Lightpanda Browser
概要
Lightpanda は、AI および自動化ワークロードのためにゼロから構築されたヘッドレスブラウザです。Chrome/Chromium ベースのツール(Puppeteer、Playwright)とは異なり、レンダリングをスキップし、DOM 操作とネットワークに焦点を当てています。これにより、10〜50 倍高速になり、メモリ使用量を 10 分の 1 に抑えることができます。Chrome DevTools Protocol (CDP) に対応しているため、既存のツールで動作します。
| 機能 | Lightpanda | Puppeteer/Playwright |
|---|---|---|
| 起動時間 | ~5ms | ~500ms |
| ページあたりのメモリ | ~2MB | ~50-100MB |
| GB RAM あたりのページ数 | ~500 | ~10-20 |
| JavaScript エンジン | Zig ベース、サブセット | フル V8/SpiderMonkey |
| CSS レンダリング | なし (DOM のみ) | フルレンダリング |
| 最適な用途 | スクレイピング、データ抽出 | ビジュアルテスト、スクリーンショット |
トレードオフ: Lightpanda は CSS をレンダリングしたり、スクリーンショットを生成したりしません。ビジュアルテストではなく、データの読み取り/抽出に特化して構築されています。
手順
ユーザーがウェブスクレイパーの構築、AI のためのブラウジングの自動化、または軽量なヘッドレスブラウジングを必要とする場合:
- Lightpanda をインストール — バイナリまたは Docker
- CDP サーバーを起動 —
lightpanda --host 127.0.0.1 --port 9222 - 既存のツールで接続 — Puppeteer、Playwright、または生の CDP
- スクレイピングロジックを構築 — ナビゲート、抽出、繰り返し
インストール
# Linux (x86_64)
curl -LO https://github.com/nichochar/lightpanda/releases/latest/download/lightpanda-x86_64-linux
chmod +x lightpanda-x86_64-linux
sudo mv lightpanda-x86_64-linux /usr/local/bin/lightpanda
# macOS (Apple Silicon)
curl -LO https://github.com/nichochar/lightpanda/releases/latest/download/lightpanda-aarch64-macos
chmod +x lightpanda-aarch64-macos
sudo mv lightpanda-aarch64-macos /usr/local/bin/lightpanda
# Docker
docker pull nichochar/lightpanda:latest
docker run -p 9222:9222 nichochar/lightpanda:latest
サーバーの起動
lightpanda --host 127.0.0.1 --port 9222
例
例 1: Puppeteer で Hacker News をスクレイピング
import puppeteer from "puppeteer-core";
const browser = await puppeteer.connect({ browserWSEndpoint: "ws://127.0.0.1:9222" });
const page = await browser.newPage();
await page.goto("https://news.ycombinator.com");
const stories = await page.evaluate(() => {
return Array.from(document.querySelectorAll(".titleline > a")).map((a) => ({
title: a.textContent,
url: a.getAttribute("href"),
}));
});
console.log(stories); // [{title: "Show HN: ...", url: "https://..."}, ...]
await browser.close();
例 2: Playwright を使用した AI スクレイピングパイプライン
"""Scrape a page and extract structured data with AI."""
import asyncio
import json
from playwright.async_api import async_playwright
from openai import OpenAI
client = OpenAI()
async def scrape_page(url: str) -> dict:
async with async_playwright() as p:
browser = await p.chromium.connect_over_cdp("http://127.0.0.1:9222")
context = browser.contexts[0]
page = await context.new_page()
await page.goto(url, wait_until="domcontentloaded")
text = await page.evaluate("""() => {
document.querySelectorAll('script, style, nav, footer, header').forEach(el => el.remove());
return document.body.innerText;
}""")
await page.close()
response = client.chat.completions.create(
model="gpt-4o-mini",
response_format={"type": "json_object"},
messages=[
{"role": "system", "content": "Extract structured data from this webpage. Return JSON with: title, main_content, key_points, entities."},
{"role": "user", "content": text[:8000]},
],
)
return json.loads(response.choices[0].message.content)
# Usage
result = asyncio.run(scrape_page("https://openai.com/blog"))
print(result) # {"title": "OpenAI Blog", "main_content": "...", "key_points": [...], "entities": [...]}
例 3: 依存関係ゼロの生の CDP
"""Direct CDP connection — zero dependencies beyond websockets."""
import json, asyncio, websockets, httpx
async def scrape_with_cdp(url: str) -> str:
resp = httpx.get("http://127.0.0.1:9222/json/version")
ws_url = resp.json()["webSocketDebuggerUrl"]
async with websockets.connect(ws_url) as ws:
msg_id = 0
async def send(method: str, params: dict = {}) -> dict:
nonlocal msg_id; msg_id += 1
await ws.send(json.dumps({"id": msg_id, "method": method, "params": params}))
while True:
resp = json.loads(await ws.recv())
if resp.get("id") == msg_id: return resp
await send("Page.navigate", {"url": url})
await asyncio.sleep(2)
result = await send("Runtime.evaluate", {"expression": "document.body.innerText", "returnByValue": True})
return result["result"]["result"]["value"]
ガイドライン
- ブラウザ接続を再利用 — ページごとに接続/切断しないでください。同じ接続で新しいページを開きます。
- ネットワークアイドルを待機しない —
networkidleの代わりにdomcontentloadedを使用します。Lightpanda は DOM に焦点を当てています。 - 同時実行ページ — Lightpanda は 50 以上の同時実行ページを簡単に処理できます。
asyncioセマフォを使用して同時実行を制御します。 - 最小限の JavaScript — Lightpanda の JS エンジンはサブセットです。
evaluate()呼び出しを単純に保ちます — DOM クエリ、複雑なフレームワークは使用しません。 - スクリーンショットなし — Lightpanda は視覚的にレンダリングしません。スクリーンショットが必要な場合は、Chromium で Playwright を使用してください。
- 制限された JavaScript — 大量の JS を使用する複雑な SPA は完全に動作しない場合があります。サーバーレンダリングされたページまたは単純なページに最適です。
- CDP サブセット — すべての CDP コマンドがまだ実装されているわけではありません。Page、Runtime、DOM、および Network ドメインに固執してください。
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Lightpanda Browser
Overview
Lightpanda is a headless browser built from scratch for AI and automation workloads. Unlike Chrome/Chromium-based tools (Puppeteer, Playwright), it skips rendering and focuses on DOM manipulation and network — making it 10-50x faster and using 10x less memory. It speaks the Chrome DevTools Protocol (CDP), so existing tools work with it.
| Feature | Lightpanda | Puppeteer/Playwright |
|---|---|---|
| Startup time | ~5ms | ~500ms |
| Memory per page | ~2MB | ~50-100MB |
| Pages per GB RAM | ~500 | ~10-20 |
| JavaScript engine | Zig-based, subset | Full V8/SpiderMonkey |
| CSS rendering | None (DOM only) | Full rendering |
| Best for | Scraping, data extraction | Visual testing, screenshots |
Trade-off: Lightpanda doesn't render CSS or produce screenshots. It's purpose-built for reading/extracting data, not visual testing.
Instructions
When a user asks to build a web scraper, automate browsing for AI, or needs lightweight headless browsing:
- Install Lightpanda — Binary or Docker
- Start the CDP server —
lightpanda --host 127.0.0.1 --port 9222 - Connect with existing tools — Puppeteer, Playwright, or raw CDP
- Build scraping logic — Navigate, extract, repeat
Installation
# Linux (x86_64)
curl -LO https://github.com/nichochar/lightpanda/releases/latest/download/lightpanda-x86_64-linux
chmod +x lightpanda-x86_64-linux
sudo mv lightpanda-x86_64-linux /usr/local/bin/lightpanda
# macOS (Apple Silicon)
curl -LO https://github.com/nichochar/lightpanda/releases/latest/download/lightpanda-aarch64-macos
chmod +x lightpanda-aarch64-macos
sudo mv lightpanda-aarch64-macos /usr/local/bin/lightpanda
# Docker
docker pull nichochar/lightpanda:latest
docker run -p 9222:9222 nichochar/lightpanda:latest
Start the server
lightpanda --host 127.0.0.1 --port 9222
Examples
Example 1: Scrape Hacker News with Puppeteer
import puppeteer from "puppeteer-core";
const browser = await puppeteer.connect({ browserWSEndpoint: "ws://127.0.0.1:9222" });
const page = await browser.newPage();
await page.goto("https://news.ycombinator.com");
const stories = await page.evaluate(() => {
return Array.from(document.querySelectorAll(".titleline > a")).map((a) => ({
title: a.textContent,
url: a.getAttribute("href"),
}));
});
console.log(stories); // [{title: "Show HN: ...", url: "https://..."}, ...]
await browser.close();
Example 2: AI Scraping Pipeline with Playwright
"""Scrape a page and extract structured data with AI."""
import asyncio
import json
from playwright.async_api import async_playwright
from openai import OpenAI
client = OpenAI()
async def scrape_page(url: str) -> dict:
async with async_playwright() as p:
browser = await p.chromium.connect_over_cdp("http://127.0.0.1:9222")
context = browser.contexts[0]
page = await context.new_page()
await page.goto(url, wait_until="domcontentloaded")
text = await page.evaluate("""() => {
document.querySelectorAll('script, style, nav, footer, header').forEach(el => el.remove());
return document.body.innerText;
}""")
await page.close()
response = client.chat.completions.create(
model="gpt-4o-mini",
response_format={"type": "json_object"},
messages=[
{"role": "system", "content": "Extract structured data from this webpage. Return JSON with: title, main_content, key_points, entities."},
{"role": "user", "content": text[:8000]},
],
)
return json.loads(response.choices[0].message.content)
# Usage
result = asyncio.run(scrape_page("https://openai.com/blog"))
print(result) # {"title": "OpenAI Blog", "main_content": "...", "key_points": [...], "entities": [...]}
Example 3: Raw CDP with Zero Dependencies
"""Direct CDP connection — zero dependencies beyond websockets."""
import json, asyncio, websockets, httpx
async def scrape_with_cdp(url: str) -> str:
resp = httpx.get("http://127.0.0.1:9222/json/version")
ws_url = resp.json()["webSocketDebuggerUrl"]
async with websockets.connect(ws_url) as ws:
msg_id = 0
async def send(method: str, params: dict = {}) -> dict:
nonlocal msg_id; msg_id += 1
await ws.send(json.dumps({"id": msg_id, "method": method, "params": params}))
while True:
resp = json.loads(await ws.recv())
if resp.get("id") == msg_id: return resp
await send("Page.navigate", {"url": url})
await asyncio.sleep(2)
result = await send("Runtime.evaluate", {"expression": "document.body.innerText", "returnByValue": True})
return result["result"]["result"]["value"]
Guidelines
- Reuse browser connections — Don't connect/disconnect per page. Open new pages on the same connection
- Skip waiting for network idle — Use
domcontentloadedinstead ofnetworkidle. Lightpanda is DOM-focused - Concurrent pages — Lightpanda handles 50+ concurrent pages easily. Use asyncio semaphores to control concurrency
- Minimal JavaScript — Lightpanda's JS engine is a subset. Keep
evaluate()calls simple — DOM queries, no complex frameworks - No screenshots — Lightpanda doesn't render visually. Use Playwright with Chromium for screenshot needs
- Limited JavaScript — Complex SPAs with heavy JS may not fully work. Best for server-rendered or simple pages
- CDP subset — Not all CDP commands are implemented yet. Stick to Page, Runtime, DOM, and Network domains