playwright-npx_skill

This skill enables automated browser tasks with Playwright and Node.js, handling JavaScript-heavy sites, complex interactions, and reusable scripting workflows.
  • Python

2.5k

GitHub Stars

2

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill openclaw/skills --skill playwright-npx

  • _meta.json296 B
  • SKILL.md6.4 KB

Overview

This skill provides code-first browser automation using Playwright run via node scripts (e.g., node script.mjs). It’s designed for JavaScript-heavy sites and tasks that need full programmatic control: scraping, screenshots, form automation, session persistence, and complex interactions. Use lighter tools when you don’t need JS execution or when you prefer interactive CLI browsing.

How this skill works

You write Node.js ES module scripts that import Playwright, launch a Chromium browser, create pages or contexts, and drive the page with navigation, selectors, clicks, fills, screenshots, and waits. Scripts run with node (example: node tmp/example.mjs). Session state can be saved and reused and headless/headed modes and debugging options are supported.

When to use it

  • Scraping sites that require JavaScript execution or SPA navigation
  • Automating form submissions, logins, and multi-step flows
  • Generating full-page screenshots or PDFs programmatically
  • Reusing custom browser logic across projects or CI jobs
  • When you need fine-grained control over waits, selectors, and context storage

Best practices

  • Keep scripts in a git-ignored tmp/ directory for easy iteration
  • Use ES modules (.mjs) and node to run scripts consistently
  • Prefer stable selectors (data-testid, ARIA roles) over brittle CSS/XPath
  • Save and reuse storageState for persistent sessions and authenticated flows
  • Add console.log and screenshots on error for faster debugging

Example use cases

  • Scrape the top 5 headlines from a JS-driven news site and output JSON
  • Take full-page screenshots of product pages for visual QA
  • Automate login + submission workflows and persist the session to reuse later
  • Record interactions with npx playwright codegen, paste into a .mjs script, and run with node
  • Wait for networkidle or specific selectors to reliably extract dynamically loaded content

FAQ

No. Use a lightweight fetch tool when the page does not require JavaScript execution. This skill is for pages that render or load data in the browser.

How do I debug flaky selectors or timing issues?

Run with headful mode (headless: false) and slowMo, use page.screenshot() on errors, and leverage waitForSelector, waitForLoadState('networkidle'), or waitForFunction for specific conditions.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational