Skip to main content
Extract structured data from the current page.
data = await page.extract(
    "Extract all product names and prices",
    schema={
        "type": "array",
        "items": {
            "type": "object",
            "properties": {
                "name": {"type": "string"},
                "price": {"type": "number"},
            },
        },
    },
)
print(data)
ParameterTypeRequiredDescription
promptstr / stringYesWhat to extract.
schemadict | list | str / Record<string, unknown>NoJSON schema for output.
error_code_mapping / errorCodeMappingdict / Record<string, string>NoCustom error codes.
Returns dict | list | str | None / Record<string, unknown> | unknown[] | string | null.