Install
openclaw skills install page-agentEnhanced browser DOM manipulation using PageAgent's page-controller. Injects into any web page to provide precise DOM extraction, interactive element detection (cursor:pointer heuristic), and robust interaction (full event chain simulation, React-compatible input). Use when you need to operate on web pages with precision — clicking, typing, scrolling, form filling, or reading page structure. Combines with frontend-design skill for full design→code→browser-operate workflow.
openclaw skills install page-agentInjects alibaba/page-agent v1.5.6 PageController into web pages via the browser tool's evaluate action. Gives you superior DOM manipulation compared to basic browser actions.
.click())[N]<tag> format for precise LLM-directed operations*[N] marks new elements since last stepUse the CDP injection script (handles the 72KB library injection):
node ~/.openclaw/workspace/skills/page-agent/scripts/inject-cdp.mjs <TARGET_ID>
Where TARGET_ID is from browser(action="open", ...). The script injects both page-controller-global.js and inject.js via CDP WebSocket, outputting ✅ injected on success.
// Returns { url, title, header, content, footer }
// content is the LLM-readable simplified HTML with indexed interactive elements
const state = await window.__PA__.getState();
return JSON.stringify({ url: state.url, title: state.title, content: state.content, footer: state.footer });
The content field looks like:
[0]<a aria-label=首页 />
[1]<div >PageAgent />
[2]<button role=button>快速开始 />
[3]<input placeholder=搜索... type=text />
// Click element at index 2
await window.__PA__.click(2);
// Type text into input at index 3
await window.__PA__.input(3, "hello world");
// Select dropdown option
await window.__PA__.select(5, "Option A");
// Scroll down 1 page
await window.__PA__.scroll(true, 1);
// Scroll specific element
await window.__PA__.scrollElement(4, true, 1);
After each action, call getState() again to see the updated DOM. Look for *[N] markers which indicate newly appeared elements.
frontend-design skill to create the pagenpx serve or framework dev server)browser(action="open", targetUrl="http://localhost:3000")content output is token-efficient — use it instead of screenshots when possiblewindow.__PA__.cleanUp() before taking screenshotsprofile="openclaw" for the isolated browser, or profile="chrome" for the Chrome extension relayscripts/page-controller.js — PageController library (72KB, from @page-agent/page-controller@1.5.6)scripts/inject.js — Helper wrapper that creates window.__PA__ API