puppeteer-automation
This skill teaches you how to harness Puppeteer for programmatic browser control, from launching headless instances to navigating pages and extracting data at scale. You'll discover patterns for reliable web scraping, form automation, and performance testing without manual intervention. Perfect for developers building data pipelines or testing complex web applications.
puppeteer-automation teaches you to launch headless Chrome instances and control them programmatically. You start by installing Puppeteer, then use it to open a browser, navigate to URLs, and interact with pages. The skill covers launching browsers with custom options, creating new pages, and executing JavaScript in the page context. You'll learn to chain methods for common workflows like navigation, waiting for elements, and data extraction—all without manual browser interaction.
AI-generated summary based on this skill's SKILL.md
Install
Mindrally/skills/puppeteer-automation
git clone https://github.com/Mindrally/skills
cp -r skills/puppeteer-automation ~/.claude/skills/puppeteer-automationFrequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
How do you automate a browser with Puppeteer?
puppeteer-automation teaches you to launch headless Chrome instances and control them programmatically. You start by installing Puppeteer, then use it to open a browser, navigate to URLs, and interact with pages. The skill covers launching browsers with custom options, creating new pages, and executing JavaScript in the page context. You'll learn to chain methods for common workflows like navigation, waiting for elements, and data extraction—all without manual browser interaction.
What are the best practices for web scraping with Puppeteer?
puppeteer-automation emphasizes reliable scraping patterns that handle dynamic content and avoid detection. Key practices include using appropriate waiting strategies (waitForSelector, waitForNavigation) instead of fixed delays, implementing error handling and retry logic for flaky networks, and respecting robots.txt and rate limits. The skill also covers managing cookies and authentication to maintain session state, handling popups and new tabs gracefully, and structuring your code for maintainability when scaling to parallel scraping with tools like Puppeteer Cluster.
How can you wait for an element to load in Puppeteer?
puppeteer-automation covers multiple waiting strategies to handle dynamic content reliably. You can use waitForSelector() to pause until a specific CSS selector appears, waitForXPath() for XPath expressions, or waitForFunction() for custom conditions. The skill teaches you to combine these with timeout options and error handling so your automation doesn't hang indefinitely. You'll also learn the difference between waiting for an element to exist in the DOM versus waiting for it to be visible or interactive, which is crucial for modern single-page applications.
What features does puppeteer-automation cover for screenshot and PDF generation?
puppeteer-automation includes comprehensive guidance on capturing visual output from web pages. The screenshot() method lets you save full-page or clipped images in PNG or JPEG format, while pdf() generates PDFs with customizable margins, headers, and footers. The skill teaches you to set the viewport size before capture to control output dimensions, handle rendering delays, and automate visual regression testing. You'll learn to combine these features with navigation and form submission to create automated reporting pipelines.
How does puppeteer-automation help with error handling and retry logic?
puppeteer-automation provides patterns for building resilient automation that handles network failures, timeouts, and unexpected page states. You'll learn to wrap navigation and element interactions in try-catch blocks, implement exponential backoff retry strategies, and use custom error classes to distinguish between recoverable and fatal failures. The skill covers timeout configuration at multiple levels (browser, page, and individual operations) and teaches you to log and monitor failures for debugging. These patterns are essential for long-running tasks and parallel scraping operations.
Can puppeteer-automation help with network interception and form submission automation?
puppeteer-automation covers both network interception and form automation extensively. For network control, you'll learn to intercept requests and responses, modify headers or block certain resources to speed up scraping, and monitor network activity for debugging. For forms, the skill teaches you to locate input fields using CSS or XPath selectors, simulate keyboard input with type() and keyboard events, click buttons, and submit forms programmatically. You'll also learn to handle multi-step forms, file uploads, and JavaScript-triggered submissions—all critical for automating complex web interactions.
SKILL.md
rendered from the published skill — quoted content, verbatim
Puppeteer Browser Automation
You are an expert in Puppeteer, Node.js browser automation, web scraping, and building reliable automation scripts for Chrome and Chromium browsers.
Core Expertise
- Puppeteer API and browser automation patterns
- Page navigation and interaction
- Element selection and manipulation
- Screenshot and PDF generation
- Network request interception
- Headless and headful browser modes
- Performance optimization and memory management
- Integration with testing frameworks (Jest, Mocha)
Key Principles
- Write clean, async/await based code for readability
- Use proper error handling with try/catch blocks
- Implement robust waiting strategies for dynamic content
- Close browser instances properly to prevent memory leaks
- Follow modular design patterns for reusable automation code
- Handle browser context and page lifecycle appropriately
Project Setup
npm init -y
npm install puppeteer
Basic
(truncated - see the full file via the links below)
Read as markdown · JSON record · Browse the source repository
File tree — 1 file
puppeteer-automation/SKILL.md