Heal an extractor
heal_extractorRepair a web data extractor after a page redesign by relearning from new pages and identifying where each field moved, including lost data that needs manual attention.
Instructions
Learn pages again after a redesign, and say what moved where.
extractor: the object compile_extractor returned. pages: http(s) URLs, or the HTML itself, of the redesigned pages.
Returns {"ok", "extractor", "changes", "lost"}. A field that moved keeps its old name, so rows read with the healed extractor keep their columns, and its change carries the evidence: how many of the values it was learnt with were found in the new place. "lost" is true when a change is data the page no longer has -- vanished, summary-lost, type-lost, listing-lost, or broken: a selector written by hand that the pages no longer bear out, which heal never rewrites -- and then ok is false: the old extractor, which keeps failing, is the safer one to keep until a person looks. A healed extractor heavier than 75,000 bytes is too_large.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pages | Yes | http(s) URLs, or the HTML itself, of the redesigned pages. | |
| extractor | Yes | the object compile_extractor returned. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| lost | No | ||
| error | No | ||
| changes | No | ||
| extractor | No |