Inputs

scrapy-poet integration, if enabled during the initial setup, allows obtaining the following inputs from web-poet and zyte-common-items through Zyte API:

Additional inputs and input annotations are also provided:

Built-in inputs

class scrapy_zyte_api.Actions(results: List[_ActionResult] | None)[source]

A page input that specifies browser actions and contains their results.

The actions must be specified with an annotation using actions().

results: List[_ActionResult] | None

Results of actions.

class scrapy_zyte_api.Geolocation[source]

A page input that forces a given geolocation for all other page inputs.

The target geolocation must be specified with an annotation.

class scrapy_zyte_api.Screenshot(body: bytes)[source]

A container for holding the screenshot of a webpage.

body: bytes

Body.

Built-in input annotations

enum scrapy_zyte_api.ExtractFrom(value)[source]

Annotation to specify the extraction source of an automatic extraction input, such as Product or Article.

See Dependency annotations.

Member Type:

str

Valid values are as follows:

httpResponseBody: str = <ExtractFrom.httpResponseBody: 'httpResponseBody'>
browserHtml: str = <ExtractFrom.browserHtml: 'browserHtml'>
scrapy_zyte_api.actions(value: Iterable[Action]) Tuple[Any, ...][source]

Convert an iterable of Action dicts into a hashable value.

scrapy_zyte_api.custom_attrs(input: Dict[str, Any], options: Dict[str, Any] | None = None) Tuple[FrozenSet[Any], FrozenSet[Any] | None][source]