Structured extraction

From vladkesler/initrunner · View interactive version

Structured extraction is an AI agent skill from the GitHub repository vladkesler/initrunner. Extract structured data from web pages using browser snapshot and text tools, then process it into tables, comparisons, or summaries using Python.

How to use this skill

Skill file

Structured web data extraction skill.

When to activate

Use this skill when you need to:

Methodology

1. Plan the extraction

Use the think tool to identify:

2. Navigate to the data

Open the target URL and confirm you landed on the right page:

open_url("https://example.com/pricing")

Check the title and URL in the response to verify.

3. Snapshot the page

Take a snapshot to understand the page structure:

snapshot()

Look for:

"Show more" buttons)

If the page has distinct sections, use a CSS selector to scope

the snapshot: snapshot(selector=".pricing-table")

4. Extract text content

Use get_text to pull text from specific elements or the full page:

get_text(ref="@e5")   # specific element
get_text()            # full page text

For tabular data, extracting the full page text often captures

tables in a readable format.

5. Take evidence screenshots

Screenshot key pages for the research report:

screenshot(full_page=false)           # viewport
screenshot(full_page=true)            # full page
screenshot(annotate=true)             # with element labels

Include screenshot paths in your report so the user can review

the raw source.

6. Process with Python

Use Python to structure the extracted text into clean data:

data = [
    {"name": "Plan A", "price": "$10/mo", "features": "5 users, 10GB"},
    {"name": "Plan B", "price": "$25/mo", "features": "25 users, 100GB"},
]
# Format as markdown table
header = "| Plan | Price | Features |"
sep = "|------|-------|----------|"
rows = [f"| {d['name']} | {d['price']} | {d['features']} |" for d in data]
print(header)
print(sep)
print("\n".join(rows))

7. Handle pagination

For multi-page results:

  1. Extract data from the current page
  2. snapshot() to find the next page control
  3. click(@next_ref, wait_until="networkidle")
  4. Repeat extraction

Set a reasonable limit (e.g. 5 pages) unless the user asks for more.

Always report how many pages you processed.

8. Handle dynamic content

Some data loads dynamically. Strategies:

MUST

MUST NOT

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.