playwright-web-scraper▌
dawiddutoit/custom-claude · updated Apr 8, 2026
MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.
Extract structured data from multiple web pages with respectful, ethical crawling practices.
Playwright Web Scraper
Extract structured data from multiple web pages with respectful, ethical crawling practices.
When to Use This Skill
Use when extracting structured data from websites with "scrape data from", "extract information from pages", "collect data from site", or "crawl multiple pages".
Do NOT use for testing workflows (use playwright-e2e-testing), monitoring errors (use playwright-console-monitor), or analyzing network (use playwright-network-analyzer). Always respect robots.txt and rate limits.
Quick Start
Scrape product listings from an e-commerce site:
// 1. Validate URLs
python scripts/validate_urls.py urls.txt
// 2. Scrape pages with rate limiting
const results = [];
for (const url of urls) {
await browser_navigate({ url });
await browser_wait_for({ time: Math.random() * 2 + 1 }); // 1-3s delay
const data = await browser_evaluate({
function: `
Array.from(document.querySelectorAll('.product')).map(el => ({
title: el.querySelector('.title')?.textContent?.trim(),
price: el.querySelector('.price')?.textContent?.trim(),
url: el.querySelector('a')?.getAttribute('href')
}))
`
});
results.push(...data);
}
// 3. Process results
python scripts/process_results.py scraped.json -o products.csv
Table of Contents
- Core Workflow
- Rate Limiting Strategy
- URL Validation
- Data Extraction
- Error Handling
- Processing Results
- Supporting Files
- Expected Outcomes
Core Workflow
Step 1: Prepare URL List
Create a text file with URLs to scrape (one per line):
https://example.com/products?page=1
https://example.com/products?page=2
https://example.com/products?page=3
Validate URLs and check robots.txt compliance:
python scripts/validate_urls.py urls.txt --user-agent "MyBot/1.0"
Step 2: Initialize Scraping Session
Navigate to the site and take a snapshot to understand structure:
await browser_navigate({ url: firstUrl });
await browser_snapshot();
Identify CSS selectors for data extraction using the snapshot.
Step 3: Implement Rate-Limited Crawling
Use random delays between requests (1-3 seconds minimum):
const results = [];
for (const url of urlList) {
// Navigate to page
await browser_navigate({ url });
// Wait for content to load
await browser_wait_for({ text: 'Expected content marker' });
// Add respectful delay (1-3 seconds)
const delay = Math.random() * 2 + 1;
await browser_wait_for({ time: delay });
// Extract data
const pageData = await browser_evaluate({
function: `/* extraction code */`
});
results.push(...pageData);
// Check console for errors/warnings
const console = await browser_console_messages();
// Monitor for rate limit warnings
}
Step 4: Extract Structured Data
Use browser_evaluate to extract data with JavaScript:
const data = await browser_evaluate({
function: `
try {
return Array.from(document.querySelectorAll('.item')).map(el => ({
title: el.querySelector('.title')?.textContent?.trim(),
price: el.querySelector('.price')?.textContent?.trim(),
rating: el.querySelector('.rating')?.textContent?.trim(),
url: el.querySelector('a')?.getAttribute('href')
})).filter(item => item.title && item.price); // Filter incomplete records
} catch (e) {
console.error('Extraction failed:', e);
return [];
}
`
});
See references/extraction-patterns.md for comprehensive extraction patterns.
Step 5: Handle Errors and Rate Limits
Monitor for rate limiting indicators:
// Check HTTP responses via browser_network_requests
const requests = await browser_network_requests();
const rateLimited = requests.some(r => r.status === 429 || r.status === 503);
if (rateLimited) {
// Back off exponentially
await browser_wait_for({ time: 10 }); // Wait 10 seconds
// Retry or skip
}
// Check console for blocking messages
const console = await browser_console_messages({ pattern: 'rate limit|blocked|captcha' });
if (console.length > 0) {
// Handle blocking
}
Step 6: Aggregate and Store Results
Save results to JSON file:
// In your scraping script
fs.writeFileSync('scraped.json', JSON.stringify({ results }, null, 2));
Process and convert to desired format:
# View statistics
python scripts/process_results.py scraped.json --stats
# Convert to CSV
python scripts/process_results.py scraped.json -o output.csv
# Convert to Markdown table
python scripts/process_results.py scraped.json -o output.md
Rate Limiting Strategy
Minimum Delays
Always add delays between requests:
- Standard sites: 1-3 seconds (random)
- High-traffic sites: 3-5 seconds
- Small sites: 5-10 seconds
- After errors: Exponential backoff (5s, 10s, 20s, 40s)
Implementation
// Random delay between 1-3 seconds
const randomDelay = () => Math.random() * 2 + 1;
await browser_wait_for({ time: randomDelay() });
// Exponential backoff after rate limit
let backoffSeconds = 5;
for (let retry = 0; retry < 3; retry++) {
try {
How to use playwright-web-scraper on Cursor
AI-first code editor with Composer
Prerequisites
Before installing skills in Cursor, ensure your development environment meets these requirements:
- ›Cursor installed and configured on your development machine
- ›Node.js version 16.0+ with npm package manager (verify with
node --version) - ›Active project directory or workspace where you want to add playwright-web-scraper
Execute installation command
Execute the skills CLI command in your project's root directory to begin installation:
The skills CLI fetches playwright-web-scraper from GitHub repository dawiddutoit/custom-claude and configures it for Cursor.
Select Cursor when prompted
The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:
Verify installation
Confirm successful installation by checking the skill directory location:
Reload or restart Cursor to activate playwright-web-scraper. Access the skill through slash commands (e.g., /playwright-web-scraper) or your agent's skill management interface.
Security & Verification Notice
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.
List & Monetize Your Skill
Submit your Claude Code skill and start earning
Use Cases▌
Task Automation & Efficiency
Automate repetitive workflows and reduce manual effort
Example
Generate reports, summarize documents, draft communications
Save 3-5 hours per week on routine tasks
Knowledge Enhancement
Learn new skills, understand complex topics, get expert guidance
Example
Explain concepts, provide examples, suggest learning resources
Accelerate learning and skill development by 2x
Quality Improvement
Enhance output quality through reviews, suggestions, and refinements
Example
Review drafts, suggest improvements, catch errors
Improve work quality by 30-40% with less effort
Implementation Guide▌
Prerequisites
- ›Claude Desktop or compatible AI client with skill support
- ›Clear understanding of task or problem to solve
- ›Willingness to iterate and refine outputs
Time Estimate
15-45 minutes depending on use case complexity
Installation Steps
- 1.Install skill using provided installation command
- 2.Test with simple use case relevant to your work
- 3.Evaluate output quality and relevance
- 4.Iterate on prompts to improve results
- 5.Integrate into regular workflow if valuable
Common Pitfalls
- ⚠Expecting perfect results without iteration
- ⚠Not providing enough context in prompts
- ⚠Using skill for tasks outside its intended scope
- ⚠Accepting outputs without review and validation
Best Practices▌
✓ Do
- +Start with clear, specific prompts
- +Provide relevant context and constraints
- +Review and refine all outputs before using
- +Iterate to improve output quality
- +Document successful prompt patterns
✗ Don't
- −Don't use without understanding skill limitations
- −Don't skip validation of outputs
- −Don't share sensitive information in prompts
- −Don't expect skill to replace human judgment
💡 Pro Tips
- ★Be specific about desired format and style
- ★Ask for multiple options to choose from
- ★Request explanations to understand reasoning
- ★Combine AI efficiency with human expertise
When to Use This▌
✓ Use When
Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.
✗ Avoid When
Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.
Learning Path▌
- 1Familiarize yourself with skill capabilities and limitations
- 2Start with low-risk, non-critical tasks
- 3Progress to more complex and valuable use cases
- 4Build expertise through regular use and experimentation
Discussion
Product Hunt–style comments (not star reviews)- No comments yet — start the thread.
Ratings
4.7★★★★★50 reviews- ★★★★★Diya Menon· Dec 24, 2024
Solid pick for teams standardizing on skills: playwright-web-scraper is focused, and the summary matches what you get after install.
- ★★★★★Ganesh Mohane· Dec 16, 2024
playwright-web-scraper is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
- ★★★★★Nia Johnson· Dec 16, 2024
Useful defaults in playwright-web-scraper — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
- ★★★★★Chinedu Sharma· Dec 16, 2024
playwright-web-scraper is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
- ★★★★★Kaira Ghosh· Dec 4, 2024
I recommend playwright-web-scraper for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
- ★★★★★Chinedu Reddy· Nov 23, 2024
playwright-web-scraper fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
- ★★★★★Sakshi Patil· Nov 7, 2024
Keeps context tight: playwright-web-scraper is the kind of skill you can hand to a new teammate without a long onboarding doc.
- ★★★★★Mia Garcia· Nov 7, 2024
We added playwright-web-scraper from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
- ★★★★★Diya Dixit· Nov 7, 2024
playwright-web-scraper has been reliable in day-to-day use. Documentation quality is above average for community skills.
- ★★★★★Mia Brown· Nov 7, 2024
Keeps context tight: playwright-web-scraper is the kind of skill you can hand to a new teammate without a long onboarding doc.
showing 1-10 of 50