puppeteer
puppeteer enables you to script and control browser behavior programmatically, handling navigation, form submission, and DOM manipulation at scale. Perfect for testing, scraping, and automating repetitive web tasks without manual intervention.
puppeteer is a Node.js library that enables you to script and control browser behavior programmatically, handling navigation, form submission, and DOM manipulation at scale. It provides a high-level API over the Chrome DevTools Protocol, allowing you to automate browser interactions and page navigation tasks without manual intervention. puppeteer runs in headless mode by default, making it ideal for server-side automation, testing, and scripting workflows.
AI-generated summary based on this skill's SKILL.md
Install
AIDotNet/MoYuCode/puppeteer · repository language: TypeScript
git clone https://github.com/AIDotNet/MoYuCode
cp -r MoYuCode/skills/tools/puppeteer ~/.claude/skills/puppeteerFrequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
What is puppeteer browser automation and how does it work?
puppeteer is a Node.js library that enables you to script and control browser behavior programmatically, handling navigation, form submission, and DOM manipulation at scale. It provides a high-level API over the Chrome DevTools Protocol, allowing you to automate browser interactions and page navigation tasks without manual intervention. puppeteer runs in headless mode by default, making it ideal for server-side automation, testing, and scripting workflows.
Can puppeteer generate PDF from HTML content or web pages?
Yes, puppeteer excels at generating PDF documents from HTML content or web pages. You can load any webpage or HTML string into puppeteer and convert it directly to a PDF file with customizable options like page size, margins, and headers/footers. This capability makes puppeteer a powerful tool for automated PDF creation, document generation, and converting HTML to PDF at scale without requiring additional dependencies.
How does web scraping with puppeteer compare to other methods?
puppeteer is particularly effective for web scraping because it controls a full browser instance, allowing you to interact with JavaScript-heavy sites that traditional scrapers cannot handle. Unlike static HTML parsers, puppeteer can wait for dynamic content to load, click elements, fill forms, and extract data from websites after all rendering is complete. This makes puppeteer a headless browser scraper ideal for complex scraping scenarios where page scraping requires full browser capabilities.
What are the main use cases for puppeteer screenshot functionality?
puppeteer's screenshot capabilities enable you to capture screenshots and visual snapshots of web pages programmatically. Common use cases include automated visual regression testing, generating website preview thumbnails, documenting page states during automated testing, and creating a website screenshot generator for monitoring or archival purposes. The screenshot tool integrates seamlessly with puppeteer's automation workflow, allowing you to capture pages at any point during your browser automation JavaScript scripts.
Is puppeteer suitable for automated testing and form automation?
Absolutely. puppeteer is well-suited for automate form submission and user interaction testing, as well as headless browser testing in general. You can programmatically fill out forms, submit data, click buttons, and verify responses—all without a visible UI. This makes puppeteer an excellent choice for automated testing chrome environments, end-to-end testing workflows, and puppeteer form automation scenarios where you need reliable, repeatable browser interactions at scale.
What license does puppeteer use and what are its core capabilities?
puppeteer is released under the MIT license, making it free and open-source for both commercial and personal projects. Its core capabilities include puppeteer nodejs automation for controlling headless chromium instances, puppeteer chromium control via the Chrome DevTools Protocol, and support for browser automation JavaScript across multiple platforms. Whether you need a headless browser testing framework, a web crawler, or a document generation tool, puppeteer's MIT license and comprehensive API make it an accessible choice for developers.
SKILL.md
rendered from the published skill — quoted content, verbatim
Puppeteer Tool
Description
Headless Chrome/Chromium automation for PDF generation, screenshots, web scraping, and testing.
Source
- Repository: puppeteer/puppeteer
- License: Apache-2.0
- Maintainer: Google
Installation
npm install puppeteer
Usage Examples
Generate PDF from HTML
```typescript import puppeteer from 'puppeteer';
async function generatePDF(html: string, outputPath: string) { const browser = await puppeteer.launch(); const page = await browser.newPage();
await page.setContent(html, { waitUntil: 'networkidle0' });
await page.pdf({ path: outputPath, format: 'A4', margin: { top: '20mm', right: '20mm', bottom: '20mm', left: '20mm' }, printBackground: true, });
await browser.close(); }
// Usage const html = ` <html> <head><style>body { font-family: Arial; }</style></head> <body><h1>Invoice
(truncated - see the full file via the links below)
Read as markdown · JSON record · Browse the source repository
File tree — 1 file
skills/tools/puppeteer/SKILL.md