ExtractFunction
Index
Methods
Methods
__call__
Extract an instance of
schemafrom the current page.Parameters
schema: type[TSchema]
The Pydantic model describing the desired output.
optionalkeyword-onlyscope: str | None = None
Optional CSS selector restricting extraction to the first matching subtree. Saves tokens and prevents matches outside the region of interest.
optionalkeyword-onlycache_tag: str | None = None
Optional tag used by caching extractors to bucket cached selectors per page kind. Defaults to
context.request.label. Unlabeled requests share one bucket, which overflows fast when page kinds differ.optionalkeyword-onlyadditional_instructions: str | None = None
Extra instructions appended to the base instructions for this call only (e.g. 'the price is the discounted one, not the list price'). Does not replace the base instructions.
Returns TSchema
The
extracthelper exposed onPydanticAiCrawlingContext.Binds the configured extractor to the current page, so a handler passes just the schema and the optional per-call knobs.