Community研究&データ分析github.com

aradotso/lightpanda-browser

Lightpanda(Zig製ヘッドレスブラウザ)のエキスパートスキル。AIエージェントと自動化向けに設計され、Chrome比でメモリ9分の1、速度11倍。インストール、CLI、CDPサーバー、Playwright/Puppeteer統合、Webスクレイピングを解説。

lightpanda-browser とは?

このスキルは、AIエージェントや自動化タスク向けにZig言語で開発された超軽量ヘッドレスブラウザ「Lightpanda」を専門的に扱うためのリソースです。Chromeと比較してメモリ使用量を9分の1、処理速度を11倍に抑えることを実現し、リソース制約のあるクラウド環境や多数の並行セッションが必要なシナリオで特に有効です。スキルでは、Lightpandaのインストール手順、CLIの基本操作、CDP(Chrome DevTools Protocol)サーバーの起動方法、PlaywrightやPuppeteerを用いたプログラム制御、そして効率的なWebスクレイピングのテクニックを網羅します。対応プラットフォームはLinux、macOS、Windows(WSL2)で、Dockerコンテナでの実行もサポートしています。詳細なSKILL.mdには、各操作の具体的なコード例やベストプラクティスが含まれており、AIエージェントが自律的にLightpandaを活用する際の信頼性と効率を高めます。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/aradotso/trending-skills/tree/main/skills/lightpanda-browser

Installed? Explore more 研究&データ分析 skills: affaan-m/uspto-database, affaan-m/scholar-evaluation, affaan-m/literature-review · View all 6 →

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

lightpanda-browser は何をしますか?

Lightpanda — Zig製のヘッドレスブラウザをAIエージェントと自動化向けに活用するためのエキスパートスキル。Chrome比でメモリ9分の1、速度11倍。インストール、CLI、CDPサーバー、Playwright/Puppeteer統合、Webスクレイピングに対応。

目次

概要

Lightpandaは、ヘッドレスブラウザをZigで一から実装したプロジェクトです。以下の特徴があります:

  • 高速: Chromeより11倍高速なページ読み込み
  • 低メモリ: メモリ使用量はChromeの9分の1
  • API互換: CDP(Chrome DevTools Protocol)対応により、PlaywrightやPuppeteerと連携可能
  • 軽量バイナリ: 単一バイナリで配布

インストール

各プラットフォーム向け

# Linux (x86_64)
curl -L https://github.com/lightpanda-io/lightpanda/releases/latest/download/lightpanda-linux-x86_64.tar.gz | tar xz
sudo mv lightpanda /usr/local/bin/

# macOS (Apple Silicon)
brew install lightpanda-io/tap/lightpanda

# Windows (WSL2推奨)
# WSL2上のUbuntuでLinux版インストール手順を実行

Docker

docker pull lightpanda/lightpanda:latest
docker run -p 9222:9222 lightpanda/lightpanda

CLIの使い方

基本的なページ取得

# URLを指定してHTMLをコンソールに出力
lightpanda https://example.com

# ファイルに保存
lightpanda --output page.html https://example.com

オプション

-l, --listen <addr>    CDPサーバーのリッスンアドレス(例: 0.0.0.0:9222)
-o, --output <file>    出力ファイル
-t, --timeout <ms>     タイムアウト(ミリ秒)
-w, --wait <ms>        ページ読み込み後の待機時間
-h, --help             ヘルプを表示

CDPサーバー

CDPサーバーを起動して、外部ツールからブラウザ制御を行うことができます。

# デフォルトポート(9222)で起動
lightpanda --listen 0.0.0.0:9222

# 特定のポートで起動
lightpanda --listen localhost:8080

CDPエンドポイント

サーバー起動後、以下のエンドポイントにアクセス可能:

エンドポイント説明
/json/versionブラウザバージョン情報
/json利用可能なターゲット一覧
/devtools/browser/<id>WebSocket接続エンドポイント

Playwright/Puppeteerとの連携

Playwright(Python)

import asyncio
from playwright.async_api import async_playwright

async def main():
    async with async_playwright() as p:
        browser = await p.chromium.connect_over_cdp("http://localhost:9222")
        page = await browser.new_page()
        await page.goto("https://example.com")
        title = await page.title()
        print(f"ページタイトル: {title}")
        await browser.close()

asyncio.run(main())

Puppeteer(Node.js)

const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.connect({
    browserURL: 'http://localhost:9222'
  });
  const page = await browser.newPage();
  await page.goto('https://example.com');
  const title = await page.title();
  console.log(`ページタイトル: ${title}`);
  await browser.close();
})();

Webスクレイピング

静的ページのスクレイピング

# シンプルな取得
lightpanda --output response.html https://target-site.com

# 待機時間を設定してJavaScript実行後に取得
lightpanda --wait 3000 --output page.html https://single-page-app.com

JavaScriptによる動的コンテンツの抽出

CDPサーバー経由で接続し、ページ内のJavaScriptを実行:

import asyncio
from playwright.async_api import async_playwright

async def scrape_dynamic():
    async with async_playwright() as p:
        browser = await p.chromium.connect_over_cdp("http://localhost:9222")
        page = await browser.new_page()
        await page.goto("https://dynamic-site.com")
        # JavaScriptを実行してデータを抽出
        data = await page.evaluate("""() => {
            return {
                title: document.title,
                items: Array.from(document.querySelectorAll('.item')).map(el => el.textContent)
            }
        }""")
        print(data)
        await browser.close()

asyncio.run(scrape_dynamic())

設定オプション

環境変数による設定:

環境変数説明デフォルト値
LIGHTPANDA_PORTCDPサーバーのポート9222
LIGHTPANDA_HOSTリッスンアドレス127.0.0.1
LIGHTPANDA_TIMEOUTデフォルトタイムアウト(ms)30000
LIGHTPANDA_USER_AGENTカスタムUser-Agentなし
LIGHTPANDA_HEADLESSヘッドレスモード(常にtrue)true

トラブルシューティング

よくある問題

  1. ポートが既に使用されています

    • 別のポートを指定するか、既存のプロセスを終了してください。
    lsof -i :9222
    kill <PID>
    
  2. Playwright/Puppeteerが接続できない

    • CDPサーバーが起動しているか確認:curl http://localhost:9222/json/version
    • ファイアウォール設定を確認。
  3. ページが正しくレンダリングされない

    • 特にSPAの場合は--waitオプションで待機時間を増やしてください。
    • JavaScriptエラーが原因の場合、ブラウザのコンソールログを確認。
  4. バイナリが見つからない

    • パスが通っているか確認:which lightpanda
    • またはインストールディレクトリから直接実行。

サポート

詳細は Lightpanda公式ドキュメント を参照してください。 バグ報告や機能リクエストは GitHub Issues まで。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

aradotso/724-office-ai-agent

Self-evolving AI agent system with 26 tools, three-layer memory, MCP plugins, and 24/7 self-repair in pure Python.

aradotso/agency-agents-ai-specialists

A collection of specialized AI agent personalities for Claude Code, Cursor, Aider, Windsurf, and other AI coding tools — covering engineering, design, marketing, sales, and more.

aradotso/agent-browser-automation

Headless browser automation CLI for AI agents using native Rust binary with Chrome DevTools Protocol

aradotso/antigravity-manager

AI coding agent skill for Antigravity Manager — a Tauri v2 + Rust desktop app and Docker service that manages multiple Google/Anthropic accounts and proxies them as standard OpenAI/Anthropic/Gemini API endpoints with intelligent account rotation.

aradotso/aracli-deploy-management

Guide to deploying and managing OpenClaw-compatible AI agent systems across cloud, bare metal, and hybrid infrastructure.

aradotso/autoresearchclaw-autonomous-research

Fully autonomous research pipeline that turns a topic idea into a complete academic paper with real citations, experiments, and conference-ready LaTeX.

aradotso/autoresearch-genealogy

Structured prompts, vault templates, and autonomous research workflows for AI-assisted genealogy using Claude Code.

aradotso/brreg

Search and retrieve Norwegian company data from Brønnøysundregistrene (the Norwegian Business Registry). Access all ~1.2 million registered companies in Norway.

aradotso/chrome-cdp-live-browser

Give AI agents access to your live Chrome session via CDP — interact with open tabs, logged-in accounts, and current page state

aradotso/claude-hud-statusline

A Claude Code plugin that displays a real-time HUD showing context usage, active tools, running agents, and todo progress in your terminal statusline.

aradotso/claude-peers-mcp

Enable multiple Claude Code instances to discover each other and exchange messages in real-time via a local broker daemon and MCP server.

aradotso/clui-cc-claude-overlay

Command Line User Interface for Claude Code — a floating macOS desktop overlay with multi-tab sessions, permission approval UI, voice input, and skills marketplace.

aradotso/cmux-terminal-multiplexer

AI-native terminal multiplexer with programmable socket API, full Playwright-equivalent browser automation, and agent team coordination — built for Claude Code and autonomous agent workflows

aradotso/code-review-graph

Build a persistent knowledge graph of your codebase so Claude reads only what matters — up to 49x fewer tokens on coding tasks.

aradotso/codex-autoresearch-loop

Self-directed iterative research skill for Codex that continuously cycles through modify, verify, retain or discard, and repeat until a measurable goal is reached.

aradotso/copaw-ai-assistant

Personal AI assistant framework supporting multiple chat channels (DingTalk, Feishu, QQ, Discord, etc.) with extensible skills, local/cloud deployment, and cron scheduling.

aradotso/corridorkey-green-screen

AI-powered green screen keyer that unmixes foreground colors and generates clean linear alpha channels using neural networks

aradotso/crucix-intelligence-dashboard

Personal intelligence agent that aggregates 27 OSINT data sources into a self-hosted Jarvis-style dashboard with Telegram/Discord bots, LLM analysis, and real-time alerts.

aradotso/daily-stock-analysis

LLM-powered A/H/US stock intelligent analysis system with multi-source data, real-time news, AI decision dashboards, and multi-channel push notifications via GitHub Actions.

aradotso/deepseek-ocr

Expert skill for using DeepSeek-OCR, a vision-language model for optical character recognition with context optical compression supporting documents, PDFs, and images.

関連スキル