Extract Structured Data
Describe what you want and the shape you want it in. The extract invocation runs inside the runtime, reads the page, and returns output validated against your schema - zod in TypeScript, Pydantic in Python.
The schema is enforced server-side: if the model produces output that doesn’t validate, the invocation fails with invocation.output_validation_failed instead of handing you malformed JSON. In Python, parsed_output is the instantiated Pydantic model, not a dict.
You can also navigate with your own CDP code first and call extract on whatever page the browser is on - the invocation always acts on the active target.
Next
- Invocations - all hosted actions
- Stagehand on BCTRL - act + observe + extract as a flow
- Run a Hosted Agent - multi-step tasks, not single reads

