Puppeteer
Automate Chrome and Chromium with Puppeteer for scraping, testing, screenshots, and browser workflows.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/1215656/puppeteer-1-0-0Setup
On first use, read setup.md for integration guidelines.
When to Use
User needs browser automation: web scraping, E2E testing, PDF generation, screenshots, or any headless Chrome task. Agent handles page navigation, element interaction, waiting strategies, and data extraction.
Architecture
Scripts and outputs in ~/puppeteer/. See memory-template.md for structure.
~/puppeteer/
├── memory.md # Status + preferences
├── scripts/ # Reusable automation scripts
└── output/ # Screenshots, PDFs, scraped data
Quick Reference
| Topic | File |
|---|---|
| Setup process | setup.md |
| Memory template | memory-template.md |
| Selectors guide | selectors.md |
| Waiting patterns | waiting.md |
Core Rules
1. Always Wait Before Acting
Never click or type immediately after navigation. Always wait for the element:
await page.waitForSelector('#button');
await page.click('#button');
Clicking without waiting causes "element not found" errors 90% of the time.
2. Use Specific Selectors
Prefer stable selectors in this order:
[data-testid="submit"]— test attributes (most stable)#unique-id— IDsform button[type="submit"]— semantic combinations.class-name— classes (least stable, changes often)
Avoid: div > div > div > button — breaks on any DOM change.
3. Handle Navigation Explicitly
After clicks that navigate, wait for navigation:
await Promise.all([
page.waitForNavigation(),
page.click('a.next-page')
]);
Without this, the script continues before the new page loads.
4. Set Realistic Viewport
Always set viewport for consistent rendering:
await page.setViewport({ width: 1280, height: 800 });
Default viewport is 800x600 — many sites render differently or show mobile views.
5. Handle Popups and Dialogs
Dismiss dialogs before they block interaction:
page.on('dialog', async dialog => {
await dialog.dismiss(); // or dialog.accept()
});
Unhandled dialogs freeze the script.
6. Close Browser on Errors
Always wrap in try/finally:
const browser = await puppeteer.launch();
try {
// ... automation code
} finally {
await browser.close();
}
Leaked browser processes consume memory and ports.
7. Respect Rate Limits
Add delays between requests to avoid blocks:
await page.waitForTimeout(1000 + Math.random() * 2000);
Hammering sites triggers CAPTCHAs and IP bans.
Common Traps
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-1215656-puppeteer-1-0-0": {
"enabled": true,
"auto_update": true
}
}
}Related Skills
terminal-command-execution
Execute terminal commands safely and reliably with clear pre-checks, output validation, and recovery steps. Use when users ask to run shell/CLI commands, inspect system state, manage files, install dependencies, start services, debug command failures, or automate command-line workflows.
notebooklm
Use this skill to query your Google NotebookLM notebooks directly from Claude Code for source-grounded, citation-backed answers from Gemini. Browser automation, library management, persistent auth. Drastically reduced hallucinations through document-only responses.
filesystem
Advanced filesystem operations - listing, searching, batch processing, and directory analysis for Clawdbot
self-improvement
Captures learnings, errors, and corrections to enable continuous improvement. Use when: (1) A command or operation fails unexpectedly, (2) User corrects Claude ('No, that's wrong...', 'Actually...'), (3) User requests a capability that doesn't exist, (4) An external API or tool fails, (5) Claude realizes its knowledge is outdated or incorrect, (6) A better approach is discovered for a recurring task. Also review learnings before major tasks.
botlearn-healthcheck
Autonomously inspects a live OpenClaw instance across 5 health domains (hardware, config, security, skills, autonomy) and delivers a quantified traffic-light report with actionable fix guidance.