playwright-scraper

alphaonedev/openclaw-graph · updated Apr 22, 2026

MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.

$npx skills add https://github.com/alphaonedev/openclaw-graph --skill playwright-scraper
0 commentsdiscussion
summary

Web scraping for dynamic content, authentication, pagination, and data extraction using Playwright.

  • Handles JavaScript-rendered sites, login flows, and multi-page navigation with built-in wait strategies and selector management
  • Supports headless and visible browser modes, with async patterns for reliable automation across flaky elements
  • Extracts data via selectors with JSON output, captures screenshots and PDFs, and manages cookies and sessions per context
  • Configure via JSON files
skill.md

playwright-scraper

Purpose

This skill enables web scraping using Playwright, a Node.js library for browser automation. It focuses on handling dynamic content, authentication flows, pagination, data extraction, and screenshots to reliably scrape modern websites.

When to Use

Use this skill for scraping sites with JavaScript-rendered content (e.g., React or Angular apps), sites requiring login (e.g., dashboards), handling multi-page results (e.g., search results), or capturing visual data (e.g., screenshots for verification). Avoid for static HTML sites where simpler tools like requests suffice.

Key Capabilities

  • Dynamically load and interact with content using Playwright's browser control.
  • Manage authentication flows, such as logging in via forms or API tokens.
  • Handle pagination by navigating pages, clicking "next" buttons, or parsing URLs.
  • Extract data using selectors, with options for JSON output or file saves.
  • Capture screenshots or full-page PDFs for debugging or reporting.
  • Supports headless or visible browser modes for flexibility.

Usage Patterns

Always initialize a browser context first, then create pages for navigation. Use async patterns for reliability. For authenticated scraping, handle cookies or sessions per context. Structure scripts to loop through pages for pagination and use try-catch for flaky elements. Pass configurations via JSON files or environment variables for reusability.

Common Commands/API

Use Playwright's Node.js API. Install via npm install playwright. Key methods include:

  • Launch browser: const browser = await playwright.chromium.launch({ headless: true });
  • Navigate page: const page = await browser.newPage(); await page.goto('https://example.com');
  • Handle auth: await page.fill('#username', process.env.USERNAME); await page.fill('#password', process.env.PASSWORD); await page.click('#login');
  • Extract data: const data = await page.evaluate(() => document.querySelector('#target').innerText); console.log(data);
  • Pagination: while (await page.$('#next-button')) { await page.click('#next-button'); await page.waitForSelector('.item'); }
  • Take screenshot: await page.screenshot({ path: 'screenshot.png' }); CLI flags for running scripts: Use npx playwright test with flags like --headed for visible mode or --timeout 30000 for extended waits.

Integration Notes

Integrate by importing Playwright in Node.js projects. For auth, use environment variables like $PLAYWRIGHT_USERNAME and $PLAYWRIGHT_PASSWORD to avoid hardcoding. Configuration format: Use a JSON file for settings, e.g., { "url": "https://target.com", "selector": "#data-element" }. Pass it via script args: node scraper.js --config config.json. For larger systems, chain with tools like Puppeteer (if migrating) or export data to databases via page.evaluate results. Ensure compatibility with Node.js 14+ and handle proxy settings with browser.launch({ proxy: { server: 'http://myproxy.com:8080' } }).

Error Handling

Anticipate common errors like timeout on dynamic loads or selector failures. Use page.waitForSelector with timeouts: await page.waitForSelector('#element', { timeout: 10000 }).catch(err => console.error('Element not found:', err));. For network issues, wrap page.goto in try-catch: try { await page.goto(url, { waitUntil: 'networkidle' }); } catch (e) { console.error('Navigation failed:', e.message); await browser.close(); }. Handle authentication failures by checking for error elements: if (await page.$('#error-message')) { throw new Error('Login failed'); }. Log errors with details and retry up to 3 times using a loop.

Concrete Usage Examples

  1. Scraping a logged-in dashboard: First, set env vars: export PLAYWRIGHT_USERNAME='[email protected]' and export PLAYWRIGHT_PASSWORD='securepass'. Then, run: const browser = await playwright.chromium.launch(); const page = await browser.newPage(); await page.goto('https://dashboard.com/login'); await page.fill('#username', process.env.PLAYWRIGHT_USERNAME); await page.fill('#password', process.env.PLAYWRIGHT_PASSWORD); await page.click('#submit'); const data = await page.evaluate(() => document.querySelector('#dashboard-data').innerText); console.log(data); await browser.close(); This extracts data from a protected page.
  2. Handling pagination on a search site: Script: const browser = await playwright.chromium.launch(); const page = await browser.newPage(); await page.goto('https://search.com?q=query'); let items = []; while (true) { items.push(...await page.$$eval('.result-item', elements => elements.map(el => el.innerText))); const nextButton = await page.$('#next-page'); if (!nextButton) break; await nextButton.click(); await page.waitForTimeout(2000); } console.log(items); await browser.close(); This collects results across multiple pages.

Graph Relationships

  • Related to: "selenium-automation" (alternative browser automation tool)
  • Depends on: "node-runtime" (for Playwright execution)
  • Complements: "data-extraction" (for post-processing scraped data)
  • In cluster: "community" (shared with other open-source tools)
how to use playwright-scraper

How to use playwright-scraper on Cursor

AI-first code editor with Composer

1

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-scraper
2

Execute installation command

Execute the skills CLI command in your project's root directory to begin installation:

$npx skills add https://github.com/alphaonedev/openclaw-graph --skill playwright-scraper

The skills CLI fetches playwright-scraper from GitHub repository alphaonedev/openclaw-graph and configures it for Cursor.

3

Select Cursor when prompted

The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:

◆ Which agents do you want to install to?
│ ── Universal (.agents/skills) ── always included ────
│ • Amp
│ • Antigravity
│ • Cline
│ • Codex
│ ●Cursor(selected)
│ • Cursor
│ • Windsurf
4

Verify installation

Confirm successful installation by checking the skill directory location:

.cursor/skills/playwright-scraper

Reload or restart Cursor to activate playwright-scraper. Access the skill through slash commands (e.g., /playwright-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

GET_STARTED →

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. 1.Install skill using provided installation command
  2. 2.Test with simple use case relevant to your work
  3. 3.Evaluate output quality and relevance
  4. 4.Iterate on prompts to improve results
  5. 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

  1. 1Familiarize yourself with skill capabilities and limitations
  2. 2Start with low-risk, non-critical tasks
  3. 3Progress to more complex and valuable use cases
  4. 4Build expertise through regular use and experimentation

Discussion

Product Hunt–style comments (not star reviews)
  • No comments yet — start the thread.
general reviews

Ratings

4.572 reviews
  • Chaitanya Patil· Dec 24, 2024

    Registry listing for playwright-scraper matched our evaluation — installs cleanly and behaves as described in the markdown.

  • Evelyn Kim· Dec 12, 2024

    playwright-scraper has been reliable in day-to-day use. Documentation quality is above average for community skills.

  • Chinedu Mehta· Dec 8, 2024

    Keeps context tight: playwright-scraper is the kind of skill you can hand to a new teammate without a long onboarding doc.

  • Benjamin Martinez· Dec 8, 2024

    Useful defaults in playwright-scraper — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.

  • Soo Gupta· Dec 8, 2024

    Solid pick for teams standardizing on skills: playwright-scraper is focused, and the summary matches what you get after install.

  • William Gupta· Dec 8, 2024

    playwright-scraper is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.

  • William Ghosh· Dec 4, 2024

    playwright-scraper is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.

  • Benjamin Robinson· Dec 4, 2024

    playwright-scraper reduced setup friction for our internal harness; good balance of opinion and flexibility.

  • Soo Ghosh· Nov 27, 2024

    playwright-scraper has been reliable in day-to-day use. Documentation quality is above average for community skills.

  • Noah Jackson· Nov 27, 2024

    I recommend playwright-scraper for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

showing 1-10 of 72

1 / 8