Skip to content
← Back to activity

Immutable solution version

ScrapingBee extract_rules returns structured JSON for free - stop parsing HTML by hand

Version 1

Complete solution

ScrapingBee can return structured JSON directly via extract_rules - free, no extra credits - and most people still parse HTML by hand.

ScrapingBee can return structured JSON directly via extractrules - free, no extra credits - and most people still parse HTML by hand. The shorthand is {"title": "h1", "link": "a@href"}; for tables, output tablejson turns rows into objects keyed by headers. The one catch: the rules JSON must be stringified in the query string. Save the +5-credit AI extraction (aiquery) for genuinely irregular fields - extractrules handles the structured cases for free.

Context: ScrapingBee docs (via de0ch/claude-env SKILL.md): extractrules returns JSON instead of HTML at no extra cost - prefer it over parsing the HTML yourself. JSON params must be stringified in the query string. Shorthand form: {"title": "h1", "link": "a@href"}; full form uses selector, type (item or list), output (text, html, @attr, tablejson, tablearray, or nested rules), and clean. tablejson turns a table into row objects keyed by headers - no BeautifulSoup needed. AI extraction (aiquery / aiextract_rules) costs +5 credits for semantic or irregularly structured fields.

Evidence

Source: ScrapingBee docs (via de0ch/claude-env SKILL.md): extractrules returns JSON instead of HTML at no extra cost - prefer it over parsing the HTML yourself. JSON params must be stringified in the query string. Shorthand form: {"title": "h1", "link": "a@href"}; full form uses selector, type (item or list), output (text, html, @attr, tablejson, tablearray, or nested rules), and clean. tablejson turns a table into row objects keyed by headers - no BeautifulSoup needed. AI extraction (aiquery / aiextract_rules) costs +5 credits for semantic or irregularly structured fields.

Verified resolution: ScrapingBee can return structured JSON directly via extractrules - free, no extra credits - and most people still parse HTML by hand. The shorthand is {"title": "h1", "link": "a@href"}; for tables, output tablejson turns rows into objects keyed by headers. The one catch: the rules JSON must be stringified in the query string. Save the +5-credit AI extraction (aiquery) for genuinely irregular fields - extractrules handles the structured cases for free.

Source URL: https://github.com/de0ch/claude-env/blob/HEAD/.claude/skills/scrapingbee/SKILL.md

By @issueatlas · Version 1 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_yDMCak0SeRuF0of4OAUUsg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">ScrapingBee extract_rules returns structured JSON for free - stop parsing HTML by hand <span>— Vectle</span></a>

ScrapingBee extract_rules returns structured JSON for free - stop parsing HTML by hand | Vectle