pandascript
БесплатноБез исполняемых скриптовНе проверенWrite PandaScript agent scripts (.js) — Lightpanda's replayable browser-automation format, run token-free with `lightpanda run script.js`.
от lightpanda-io★ 122 звезды на GitHubОб этом скилле
Writing Lightpanda agent scripts
Run with:
./lightpanda run script.js
Mental model (get this right first)
The script runs in its own V8 context — neither the page nor Node.js:
Pageis the only global.new Page()makes a page andawait page.goto(url)navigates it; every other primitive is a method on that page:const page = new Page(); await page.goto(url); page.extract({...}); page.click(sel);.- No
window,document, DOM,localStorage— read pages withpage.extract(...), run page-side JS only viapage.evaluate("..."). - No
require,process,fs, npm. Standard ECMAScript built-ins only (JSON,Map, template literals, …). page.goto(...)andpage.evaluate(...)are async — alwaysawaitthem. The other page methods are synchronous:const data = page.extract({...}), neverawait page.extract(...). The script body runs as an async function, so top-levelawaitis allowed.- Re-navigating reuses the same page:
await page.goto(url2)keepspagevalid and points it at the new URL, discarding the old page — read it before navigating away. Independent URLs don't share a page: make anew Page()for each and load them in parallel (fan-out, best practice 2). - Page
evaluate("...")cannot see script variables — interpolate values into the string. Script code cannot see page variables. - Variables persist across navigations within one run, so cross-page aggregation is plain JS.
return <value>is the script's output, printed automatically (objects/arrays as JSON). End withreturn page.extract({...});orreturn results;. A bare trailing expression is NOT printed; neither isconsole.log(JSON.stringify(...)).
Primitives
Page is the only global; new Page() makes a page and everything else is a method on it.
| Call | Notes |
|---|---|
new Page() |
Makes a page object. No navigation yet — call page.goto(url) before any other method. Make several to navigate in parallel (fan-out, best practice 2). |
page.close() |
Marks the page done; later method calls on it error. The page is otherwise reclaimed at script end. |
await page.goto(url[, { timeout, waitUntil }]) |
Async — must be awaited. Navigates the page (re-navigating reuses the same object). Waits for load. Rejects on navigation failure or timeout. Default timeout 10000 ms. waitUntil: one of "load", "domcontentloaded", "networkalmostidle", "networkidle", "settled", "done". |
page.screenshot([{ path, selector, fullPage, mode, strip, url, timeout }]) |
path is required: writes a PNG of the text layout. mode: one of "reader", "layout". |
await page.evaluate(script[, { url, timeout, save }]) |
Async — must be awaited. Page-side JS escape hatch; resolves to text (JSON for objects/arrays). Several under one Promise.all wait on their page-side fetches and timers at the same time. |
page.extract(schema) |
The only primitive returning a real JS value (object/array). The schema is its only argument. See schema below. |
page.click(selector) |
|
page.fill(selector, value) |
|
page.scroll([{ selector, x, y }]) |
|
page.waitForSelector(selector[, { timeout }]) |
waitFor* default timeout 5000 ms. |
page.waitForScript(script[, { timeout }]) |
Re-evaluates page JS until truthy. |
page.waitForState(state[, { timeout }]) |
state: one of "load", "domcontentloaded", "networkalmostidle", "networkidle", "settled", "done". |
page.hover(selector) |
|
page.press(selector, key) |
Selector first! page.press("Enter") binds "Enter" to selector and fails — use page.press(null, "Enter") or page.press({ key: "Enter" }). |
page.selectOption(selector, value) |
|
page.setChecked(selector[, checked]) |
checked defaults to true. |
page.getCookies([{ url, all }]) |
Returns an array of cookie objects for the page's host, HttpOnly ones included; [] when none match. |
page.download([{ url, path }]) |
Sends the session's cookies, so authenticated downloads work. Nothing is written unless the status is 200-203, and a failed download leaves path as it was. |
page.callPageTool([{ name, arguments }]) |
Runs a tool the page registered through WebMCP; returns its text result. |
page.classify(questions[, { selector, presets }]) |
Classifies page state or candidate elements via a decision model (Gemini Decisions or TypeSafe Jev): an array of categories, or an object of presets and questions. Replay calls the model live and needs TYPESAFE_API_KEY, or GOOGLE_API_KEY/GEMINI_API_KEY with LIGHTPANDA_DECISION_PROVIDER=gemini. |
page.acceptCookies([{ prefer, selectors }]) |
Clicks the consent control the decision model picks, then re-reads the page to check the banner went. Pass the selectors from an earlier result to click them with no model call; otherwise needs TYPESAFE_API_KEY, or GOOGLE_API_KEY/GEMINI_API_KEY with LIGHTPANDA_DECISION_PROVIDER=gemini. |
Установить pandascript в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл pandascript?
Write PandaScript agent scripts (.js) — Lightpanda's replayable browser-automation format, run token-free with `lightpanda run script.js`.
Как установить скилл pandascript?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл pandascript запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic