TopRank Skills

Home / Claw Skills / 浏览器自动化 / playwright-ws
Official OpenClaw rules 54%

playwright-ws

Browser automation via remote Playwright WebSocket server for screenshots, PDFs and testing.

Stars

0

Installs

0

Status

ACTIVE

Visibility

PUBLIC

安装方式

直接复制以下提示词,发送给你的 AI 助手即可完成安装。

请先检查是否已安装 SkillHub 商店,若未安装,请根据 https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/skillhub.md 安装 SkillHub 商店,然后安装 playwright-ws 技能。 若已安装,则直接安装 playwright-ws 技能。

Overview

Skill Key
first-it-consulting/playwright-ws
Author
first-it-consulting
Source Repo
openclaw/skills
Version
-
Source Path
skills/first-it-consulting/playwright-ws
Latest Commit SHA
1626273b09284cb7015219729d88fce5d4567756

Extracted Content

SKILL.md excerpt

# Playwright Skill

Remote browser automation via Playwright WebSocket server. No local browser installation required.

## Use Cases

| Task | Script | Description |
|------|--------|-------------|
| Screenshot | `scripts/screenshot.js` | Capture screenshots of web pages |
| PDF | `scripts/pdf-export.js` | Generate PDFs from URLs |
| Test | `scripts/test-runner.js` | Run Playwright tests remotely |

## Installation

```bash
cd playwright-skill
npm install
export PLAYWRIGHT_WS=ws://your-server:3000
```

## Quick Start

```bash
# Screenshot
node scripts/screenshot.js https://example.com screenshot.png --full-page

# PDF
node scripts/pdf-export.js https://example.com page.pdf
```

## Configuration

Set `PLAYWRIGHT_WS` environment variable to your Playwright WebSocket URL:

```bash
export PLAYWRIGHT_WS=ws://your-playwright-server:3000
```

## Scripts

- `screenshot.js` - Take screenshots with options
- `pdf-export.js` - Generate PDFs
- `test-runner.js` - Run remote tests

## References

- `references/selectors.md` - Selector strategies
- `references/api-reference.md` - API documentation

README excerpt

# 🎭 Playwright Skill for OpenClaw

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Node.js](https://img.shields.io/badge/Node.js-18%2B-green)](https://nodejs.org/)
[![Playwright](https://img.shields.io/badge/Playwright-1.40%2B-blue)](https://playwright.dev/)

> Remote browser automation for OpenClaw agents. No local browser installation required.

## ✨ Features

- 📸 **Screenshots** – Capture full-page or viewport screenshots via remote server
- 📄 **PDF Export** – Generate PDFs from any URL
- 🧪 **Test Runner** – Execute Playwright tests on remote infrastructure
- 🌐 **Multi-browser** – Chromium, Firefox, WebKit support
- 🔧 **Zero Install** – No local browsers needed

## 🚀 Quick Start

### 1. Configure WebSocket URL

```bash
export PLAYWRIGHT_WS=ws://your-playwright-server:3000
```

### 2. Take a Screenshot

```bash
node scripts/screenshot.js https://example.com screenshot.png
node scripts/screenshot.js https://example.com screenshot.png --full-page
node scripts/screenshot.js https://example.com screenshot.png --wait-for=".loaded" --delay=1000
```

### 3. Generate PDF

```bash
node scripts/pdf-export.js https://example.com page.pdf
node scripts/pdf-export.js https://example.com page.pdf --format=A4 --landscape
```

### 4. Run Tests

```bash
node scripts/test-runner.js
node scripts/test-runner.js --headed --project=chromium
```

## 📋 Requirements

- Node.js 18+
- Remote Playwright server running
- Environment variable `PLAYWRIGHT_SERVER` set

## 🔧 Installation

```bash
# Clone the skill
git clone https://github.com/first-it-consulting/playwright-skill.git
cd playwright-skill

# Install dependencies
npm install
```

## 📚 API Reference

Your Playwright server must expose a WebSocket endpoint for browser connections:

```
WS ws://your-server:3000/
```

### Environment Variables

| Variable | Default | Description |
|----------|---------|-------------|
| `PLAYWRIGHT_WS` | `ws://localhost:3000` | WebSo...

Related Claw Skills