save_parser_preset
Save a parser preset to reuse by ID, and enable self-healing regeneration when site structure changes. Provide a source URL to allow it to relearn and bump version automatically.
Instructions
Store a generated parser under a name so it can be reused by id. Scrape later with scrape's preset_id instead of repeating the selectors, and every run is scored per field — when the recent success rate decays (the site redesigned), the preset regenerates itself from source_url and bumps a version. Give it a source_url whenever you can: without one it can never self-heal.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | A name you'll recognise, e.g. 'amazon product page' | |
| fields | No | The original field descriptions, so a self-heal regenerates the same shape | |
| parser | Yes | The parser to store — normally the `parser` object returned by generate_parser | |
| render | No | The page needs a browser render to show its content | |
| auto_heal | No | Regenerate automatically on decay (default true when source_url is set) | |
| source_url | No | Page to relearn from when the parser decays — required for self-healing |