跳到正文
TakoAPI
返回技能列表

playwright-npx

由 mahone-bot 提供

Web & Frontend Development
937下载量由 clawskills.sh 提供
0浏览量
0 个赞登录后即可为这个技能点赞
—暂无评分
你的评分

简介

Fast browser automation using Node.js scripts with Playwright (run via `node script.mjs`)

描述

该技能的功能

Browser automation skill using Playwright and Node.js scripts. Handles JavaScript-heavy sites, form interactions, screenshots, and data scraping. Run scripts directly with `node script.mjs`.

Gives full programmatic control over browser behavior for complex sites where simple HTTP fetching fails due to JavaScript rendering or dynamic content.

何时使用

  • Scraping data from JavaScript-rendered pages
  • Taking full-page screenshots of websites
  • Automating login and form submission flows
  • Extracting structured data from news or listing sites
  • Maintaining persistent browser sessions across runs

示例工作流

输入

User asks: scrape the top 5 stories from Hacker News

智能体
  1. 1

    Create a script in tmp/ using the scrape template

  2. 2

    Launch a headless Chromium browser with Playwright

  3. 3

    Navigate to news.ycombinator.com

  4. 4

    Extract story titles and URLs using page.$$eval on .titleline > a

  5. 5

    Log results as JSON and close the browser

输出

A JSON array of 5 objects each with title and url fields printed to stdout

安装

clawhub install mahone-bot/playwright-npx

运行 CLI 命令,或把这段提示词粘贴到 Claude Code、Cursor、Codex 或你在用的任意编程智能体里。

链接