Xpersona
P

Playwright Browser Automation

CLAWHUB · Unverified

Browser automation using Playwright API directly. Navigate websites, interact with elements, extract data, take screenshots, generate PDFs, record videos, and automate complex workflows. More reliable than MCP approach. Skill: Playwright Browser Automation Owner: spiceman161 Summary: Browser automation using Playwright API directly. Navigate websites, interact with elements, extract data, take screenshots, generate PDFs, record videos, and automate complex workflows. More reliable than MCP approach. Tags: latest:2.0.0 Version history: v2.0.0 | 2026-02-08T16:47:58.871Z | user Complete rewrite with direct Playwright API, best practice

62
Rank
84
Safety
11k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 11.1K downloads reported by the source. Last updated 11/16/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s170zyx8nf7frq2g744w39tey18858x0:playwright-browser-automation
  1. Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-spiceman161-playwright-browser-automation-tomation-2/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

10,903 characters of source documentation, loaded on request.

Extracted files

3 files captured from the source.

SKILL.md

---
name: playwright-browser-automation
description: Browser automation using Playwright API directly. Navigate websites, interact with elements, extract data, take screenshots, generate PDFs, record videos, and automate complex workflows. More reliable than MCP approach.
metadata: {"openclaw":{"emoji":"🎭","os":["linux","darwin","win32"],"requires":{"bins":["node","npx"]},"install":[{"id":"npm-playwright","kind":"npm","package":"playwright","bins":["playwright"],"label":"Install Playwright"}]}}
---

# Playwright Browser Automation

Direct Playwright API for reliable browser automation without MCP complexity.

## Installation

```bash
# Install Playwright
npm install -g playwright

# Install browsers (one-time, ~100MB each)
npx playwright install chromium
# Optional:
npx playwright install firefox
npx playwright install webkit

# For system dependencies on Ubuntu/Debian:
sudo npx playwright install-deps chromium
```

## Quick Start

```javascript
const { chromium } = require('playwright');

(async () => {
  const browser = await chromium.launch({ headless: true });
  const page = await browser.newPage();
  
  await page.goto('https://example.com');
  await page.screenshot({ path: 'screenshot.png' });
  
  await browser.close();
})();
```

## Best Practices

### 1. Use Locators (Auto-waiting)

```javascript
// ✅ GOOD: Uses auto-waiting and retries
await page.getByRole('button', { name: 'Submit' }).click();
await page.getByLabel('Username').fill('user');
await page.getByPlaceholder('Search').fill('query');

// ❌ BAD: May fail if element not ready
await page.click('#submit');
```

### 2. Prefer User-Facing Attributes

```javascript
// ✅ GOOD: Resilient to DOM changes
await page.getByRole('heading', { name: 'Welcome' });
await page.getByText('Sign in');
await page.getByTestId('login-button');

// ❌ BAD: Brittle CSS selectors
await page.click('.btn-primary > div:nth-child(2)');
```

### 3. Handle Dynamic Content

```javascript
// Wait for network idle
await page.goto('https://spa-app.com', { waitUntil: 'networkidle' });

// Wait for specific element
await page.waitForSelector('.results-loaded');
await page.waitForFunction(() => document.querySelectorAll('.item').length > 0);
```

### 4. Use Contexts for Isolation

```javascript
// Each context = isolated session (cookies, storage)
const context = await browser.newContext();
const page = await context.newPage();

// Multiple pages in one context
const page2 = await context.newPage();
```

### 5. Network Interception

```javascript
// Mock API responses
await page.route('**/api/users', route => {
  route.fulfill({
    status: 200,
    body: JSON.stringify({ users: [] })
  });
});

// Block resources
await page.route('**/*.{png,jpg,css}', route => route.abort());
```

## Common Patterns

### Form Automation

```javascript
// Fill form
await page.goto('https://example.com/login');
await page.getByLabel('Username').fill('myuser');
await page.getByLabel('Password').fill('mypass');
await page.getByRole('butt

_meta.json

{
  "ownerId": "kn73rfyfbb2nt729a6f911fx2980czrm",
  "slug": "playwright-browser-automation",
  "version": "2.0.0",
  "publishedAt": 1770569278871
}

skill-card.md

## Description:

Browser automation using the Playwright API directly to navigate websites, interact with elements, extract data, take screenshots, generate PDFs, record videos, and automate complex workflows.

This skill is ready for commercial/non-commercial use.

## Publisher:

[spiceman161](https://clawhub.ai/user/spiceman161)

### License/Terms of Use:


## Use Case:

Developers and automation engineers use this skill to guide browser automation with Playwright, including navigation, interaction, data extraction, screenshots, PDFs, videos, authentication flows, and file transfer workflows.

### Deployment Geography for Use:

Global

## Known Risks and Mitigations:

Risk: The artifact includes privileged Playwright setup guidance that could create persistent passwordless root access.

Mitigation: Do not apply the sudoers instructions or run sudo npx; install Playwright through a pinned project dependency and perform browser setup in an isolated unprivileged environment.

Risk: Browser automation can create or process sensitive artifacts such as authentication state, traces, recordings, screenshots, downloads, and uploaded local files.

Mitigation: Treat those files as sensitive, store them only where needed, review them before sharing, and remove them after use.

## Reference(s):

- [ClawHub Skill Page](https://clawhub.ai/spiceman161/skills/playwright-browser-automation)
- [Playwright Docs](https://playwright.dev)
- [Playwright API Reference](https://playwright.dev/docs/api/class-playwright)
- [Playwright Best Practices](https://playwright.dev/docs/best-practices)
- [Playwright Locators Guide](https://playwright.dev/docs/locators)

## Skill Output:

**Output Type(s):** [text, markdown, guidance, code, shell commands, configuration]

**Output Format:** [Markdown with JavaScript, Python, JSON, and bash examples]

**Output Parameters:** [1D]

**Other Properties Related to Output:** [May produce browser automation guidance that handles screenshots, PDFs, videos, traces, downloads, uploads, and authentication state files.]

## Skill Version(s):

2.0.0 (source: server release metadata)

## Ethical Considerations:

Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.

Sponsored

Ads related to Playwright Browser Automation and adjacent AI workflows.