Skip to content
Automation
Command

/generate

Generate web scraper scripts using Actionbook's verified selectors.

From plugin
actionbook
1.6k16 skills12 agents16 commands1 MCP
Install
> /plugin marketplace add actionbook/actionbook
> /plugin install actionbook@actionbook-marketplace

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/generate

Context preview

What this command does when you run it.

Generate web scraper scripts using Actionbook's verified selectors.

Command definition

generate.md

/actionbook-scraper:generate

Generate web scraper scripts using Actionbook's verified selectors.

⚠️ CRITICAL: Generate → Verify → Fix Loop

**Every generated script MUST be verified by executing it. If verification fails, fix and retry.**

┌─────────────────────────────────────────────────────┐
│                                                     │
│   1. Generate Script                                │
│          ↓                                          │
│   2. Execute Script to Verify                       │
│          ↓                                          │
│   3. Check Results                                  │
│          ↓                                          │
│      ┌───┴───┐                                      │
│      │       │                                      │
│   Success  Failure                                  │
│      │       │                                      │
│      ↓       ↓                                      │
│   Output   Analyze Error → Fix Script → Go to 2    │
│   Script                                            │
│                                                     │
└─────────────────────────────────────────────────────┘

⚠️ CRITICAL: Default Output = agent-browser Script

**When `/generate <url>` is called (without --standalone):**

Output MUST be **agent-browser bash commands**, NOT Playwright/JavaScript:

agent-browser open "https://example.com"
agent-browser scroll down 2000
agent-browser get text ".selector"
agent-browser close

**Do NOT output:**

  • Playwright code
  • JavaScript code
  • .js files
  • `const { chromium } = require('playwright')`

---

**Only output Playwright when `--standalone` is specified:**

/generate <url> --standalone  →  Playwright .js code

Usage

/actionbook-scraper:generate <url> [--standalone] [--template <template>] [--output <format>]

Parameters

  • `url` (required): The full URL of the page to scrape
  • `--standalone` (optional): Generate Playwright/Puppeteer script instead of agent-browser script
  • `--template` (optional): For standalone mode: `playwright-js`, `playwright-python`, `puppeteer`. Default: `playwright-js`
  • `--output` (optional): Output format in generated script: `json`, `csv`. Default: `json`

Two Output Modes

Default Mode: Generate agent-browser Script

/actionbook-scraper:generate https://firstround.com/companies

**Output:** agent-browser commands that user can run

# Generated script - user runs this manually
agent-browser open "https://firstround.com/companies"
agent-browser wait --load networkidle
agent-browser scroll down 2000
agent-browser get text ".company-list-card-small"
agent-browser close

Standalone Mode: Generate Playwright Script

/actionbook-scraper:generate https://firstround.com/companies --standalone

**Output:** Playwright/Puppeteer JavaScript code that user can run

// Generated script - user runs: node scraper.js
const { chromium } = require('playwright');
// ... full script code

Workflow

Step 1: Search Actionbook

search_actions("firstround companies")
→ Returns action_id

Step 2: Get Selectors

get_action_by_id(action_id)
→ Returns:
   - Card: .company-list-card-small
   - Name: .company-list-card-small__button-name
   - Expand: button.company-list-card-small__button

Step 3: Generate Script

Use selectors to generate script code.

Step 4: Verify Script (Two-Part Check)

**Every script must pass BOTH checks:**

| Check | What to Verify | |-------|----------------| | **Part 1: Script Runs** | No errors, no timeouts | | **Part 2: Data Correct** | Content matches expected fields |

**For agent-browser scripts:**

# Execute commands
agent-browser open "https://example.com"
agent-browser wait --load networkidle
agent-browser get text ".selector"

# Part 1: Check no errors
# Part 2: Check data content is correct:
#   - Fields are not empty
#   - Values are actual data, not "Loading..." or "Click to expand"
#   - Field mapping is correct (name contains name, not year)

agent-browser close

**For Playwright scripts (--standalone):**

# Execute: node /tmp/scraper.js
# Part 1: Check script runs without errors
# Part 2: Check output data is correct:
#   - JSON has expected fields
#   - Values are actual content, not UI text

Step 5: Handle Results

**If BOTH checks pass:**

  • Output the verified script
  • Show extracted data preview with field validation

**If Part 1 fails (script error):**

  • Fix syntax, selector, or timeout issue
  • Retry

**If Part 2 fails (wrong data):**

  • Analyze what's wrong:
  • Extracted button text instead of content?
  • Extracted placeholder text?
  • Fields mapped incorrectly?
  • Fix extraction logic
  • Retry

**Max 3 retries** - If still failing, report the specific issue

Step 6: Return Verified Script to User

Provide:

  • The verified script code
  • Usage instructions
  • Data preview showing correct field values

Output Format

Default Mode Output (agent-browser)

## Generated Scraper (agent-browser)

**Target URL**: https://firstround.com/companies
**Selectors**: From Actionbook (verified)

### Script

Run these commands in sequence:

```bash
agent-browser open "https://firstround.com/companies"
agent-browser wait --load networkidle
agent-browser wait ".company-list-card-small"

# Scroll to load all cards
agent-browser scroll down 2000
agent-browser wait 1500
agent-browser scroll down 2000
agent-browser wait 1500

# Extract data
agent-browser get text ".company-list-card-small"

# Close browser
agent-browser close

Usage

Copy and run each command in your terminal.

Expected Output

Company data in text format that you can parse into JSON.


### Standalone Mode Output (Playwright)

```markdown
## Generated Scraper (Playwright)

**Target URL**: https://firstround.com/companies
**Template**: playwright-js

### Dependencies

```bash
npm install play
Read more
Ships withactionbook

Let your AI agent get the sources behind logins and paywalls.

Get the whole plugin

Other commands on actionbook.