Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

scraper-builder

БесплатноЗапускает вложенные скриптыНе проверен

Guide AI agents to generate complete PageObject pattern web scraper projects using Playwright and TypeScript with Docker deployment. Supports agent-browser…

jwyniaот jwynia★ 195 звёзд на GitHub2 установки в других каталогах

Об этом скилле

Scraper Builder

Generate complete, runnable web scraper projects using the PageObject pattern with Playwright and TypeScript. This skill produces site-specific scrapers with typed data extraction, Docker deployment, and optional agent-browser integration for automated site analysis.

When to Use This Skill

Use this skill when:

  • Building a site-specific web scraper for data extraction
  • Generating PageObject classes for a target website
  • Scaffolding a complete scraper project with Docker support
  • Using agent-browser to analyze a site and auto-generate selectors
  • Creating reusable scraping components (pagination, data tables)

Do NOT use this skill when:

  • Building API clients (use HTTP client libraries directly)
  • Writing QA/E2E test suites (use Playwright test runner with test-focused patterns)
  • Mass crawling or spidering entire domains (use Crawlee or Scrapy)
  • Scraping sites that require authentication bypass or CAPTCHA solving

Core Principles

1. PageObject Encapsulation

Each page on the target site maps to one PageObject class. Locators are defined in the constructor, and scraping logic lives in methods. Page objects never contain assertions or business logic — they extract and return data.

2. Selector Resilience

Prefer selectors in this order: data-testid > id > semantic HTML (role, aria-label) > structured CSS classes > text content. Avoid positional selectors (nth-child) and layout-dependent paths. See references/playwright-selectors.md for the full hierarchy.

3. Composition Over Inheritance

Reusable UI patterns (pagination, data tables, search bars) are modeled as component classes that page objects compose via properties. Only BasePage uses inheritance — everything else composes.

4. Typed Data Extraction

All scraped data flows through Zod schemas for validation. This catches selector drift (when a site changes its markup) at extraction time rather than downstream. See assets/templates/data-schema.ts.md.

5. Docker-First Deployment

Generated projects include a Dockerfile using Microsoft's official Playwright images and a docker-compose.yml with volume mounts for output data and debug screenshots. This ensures consistent browser environments across machines.

Generation Modes

Mode 1: Agent-Browser Analysis

Use agent-browser to navigate the target site, capture accessibility tree snapshots, and automatically discover selectors. This is the preferred mode when the agent has access to the agent-browser CLI.

Prerequisites: If agent-browser is not already installed, add it as a skill first:

npx skills add vercel-labs/agent-browser

Workflow:

# 1. Open the target page
agent-browser open https://example.com/products

# 2. Capture interactive snapshot with element references
agent-browser snapshot -i --json > snapshot.json

# 3. Capture scoped sections for focused analysis
agent-browser snapshot -i --json -s "main" > main-content.json
agent-browser snapshot -i --json -s "nav" > navigation.json

# 4. Test dynamic behavior (pagination, load-more)
agent-browser click @e3
agent-browser wait --load networkidle
agent-browser snapshot -i --json > after-click.json

# 5. Close when done
agent-browser close

What the agent does with snapshots:

  1. Parse element references (@e1, @e2, etc.) and their roles
  2. Group elements by semantic purpose (navigation, data display, forms, actions)
  3. Map data elements to fields (title, price, image, etc.)
  4. Generate PageObject classes with discovered selectors
  5. Identify pagination and dynamic loading patterns

See references/agent-browser-workflow.md for the complete workflow reference.

Mode 2: Manual Description

The user describes the target site's page structure and the agent maps it to page objects. The agent asks structured questions:

  1. What pages to scrape? — List of URLs or page types
  2. What data to extract? — Field names and expected types per page
  3. How is data paginated? — Numbered pages, load-more, infinite scroll, or single page
  4. What selectors are known? — Any CSS selectors, data-testid values, or XPath the user already knows

The agent then:

  • Matches the description to a site archetype from data/site-archetypes.json
  • Proposes a page object map with class names and responsibilities
  • Generates code after the user confirms the plan

Mode 3: Full Project Scaffold

Generate a complete runnable project in one operation using the scaffolder script:

deno run --allow-read --allow-write scripts/scaffold-scraper-project.ts \
  --name "my-scraper" \
  --url "https://example.com" \
  --pages "ProductListing,ProductDetail" \
  --fields "title,price,image_url,description"

This produces a project with all source files, configuration, Docker setup, and an entry point ready to run. See the Scripts Reference section for full options.

Quick Reference

Category Approach Details
Полный SKILL.md на GitHub

Установить scraper-builder в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

assets/configs/docker-compose.yml.mdassets/configs/dockerfile.mdassets/configs/package.json.mdassets/configs/playwright.config.ts.mdassets/configs/tsconfig.json.mdassets/examples/ecommerce-scraper.mdassets/examples/multi-page-pagination.mdassets/templates/base-page.ts.mdassets/templates/component.ts.mdassets/templates/data-schema.ts.mdassets/templates/page-object.ts.mdassets/templates/scraper-runner.ts.mddata/selector-patterns.jsondata/site-archetypes.jsonreferences/agent-browser-workflow.mdreferences/anti-patterns.mdreferences/docker-setup.mdreferences/pageobject-pattern.mdreferences/playwright-selectors.mdscripts/generate-page-object.tsscripts/scaffold-scraper-project.ts

FAQ

Что делает скилл scraper-builder?

Guide AI agents to generate complete PageObject pattern web scraper projects using Playwright and TypeScript with Docker deployment. Supports agent-browser site analysis for automated selector discovery. Keywords: scraper, playwright, pageobject, web scraping, docker, typescript, data extraction, automation.

Как установить скилл scraper-builder?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл scraper-builder запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить scraper-builder с