# Self-Healing Web Scraper Repair

> Fixes a scraper's broken selectors after a site redesign — and proves the fix on the live page before shipping it.

Self-Healing Web Scraper Repair is a free AI agent skill on Agensi by swastik bhat, in Workflow Automation. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [swastik bhat](https://www.agensi.io/creators/swastik-bhat)
- Category: [Workflow Automation](https://www.agensi.io/skills/workflow-automation)
- Version: 1.0
- Last updated: 2026-11-29
- Security: scan passed (2026-11-29); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/self-healing-web-scraper-repair
- Tags: automation, playwright, web-scraping, browser-automation, node-js

## About this skill

Your scraper doesn't break loudly. The site ships a redesign, one class name changes, and the 3am cron job writes an empty spreadsheet for a week before anyone notices.

scrape-heal runs the loop that closes that gap: **detect → heal → verify → settle**.

- **Detect** — every run is validated against the last good one: enough items, no empty fields, every known value still present. A selector that returns wrong-shaped data counts as broken, because it is.
- **Heal** — the last good run is the ground truth. The healer looks at the live page for elements that still contain those exact values and derives new selectors from them. No guessing at class names.
- **Verify** — the candidate selectors are re-run against the live page. The repair ships only if the shape validates, every known item is still there, and the values still look like the same kind of data.
- **Settle** — repaired, or red with evidence attached: screenshot, DOM snapshot and HTTP status for the cycle that failed.

**What the agent gets**
- SKILL.md as the entry point, with LOOP.md (the verify gate and evidence trail) and REFERENCE.md (every config key, flag and environment variable).
- scripts/run-heal.sh — one-shot repair against your last good rows, a single check, or a watchdog on a cadence. It stages the engine and Chromium itself, and --selfcheck proves the install by healing a bundled fixture.
- --init writes a commented config and --validate checks it before a run.
- Pagination for next-link, load-more, infinite-scroll and {page} URL patterns, including controls inside iframes.
- Items and healing anchors inside iframes and open shadow roots; the page wins when both match.
- Change watching, a local dashboard, a REST API, and adapters for Scrapy, Crawlee and Playwright.

**Requirements**
Node 20 or newer and npm are required. The first run installs Playwright and Chromium into ~/.scrape-heal. The launcher is bash (macOS/Linux, WSL or Git Bash). A last-good set of rows is needed to anchor a repair; without one the tool detects breakage but does not guess.

**Why verification matters**
If nothing can be verified, nothing is written and the run exits non-zero. That is the difference between a healer and a more confident way to corrupt your data.

## Requires

- Playwright
- Node.js
- Bash
- Git

## Known limitations

Requires Node.js 20+. Only repairs structural breakage; cannot bypass 403/429 blocks or CAPTCHAs. Initial run requires network for browser binaries.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Self-Healing Web Scraper Repair skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### What does Self-Healing Web Scraper Repair do?

Fixes a scraper's broken selectors after a site redesign — and proves the fix on the live page before shipping it.

### Which AI agents support Self-Healing Web Scraper Repair?

This skill uses the open SKILL.md standard. Use it through an MCP-compatible agent connected to Agensi, and check the compatibility information on this page for confirmed agents and required capabilities.

### How do I use Self-Healing Web Scraper Repair?

Connect your AI agent to Agensi through MCP, then ask it to use Self-Healing Web Scraper Repair on your task. Your agent loads the latest approved version each time. Paid skills require a purchase or active subscription. Skill files are not available for download; your licence does not allow you to save, copy or export any part of a skill.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
