Extract structured data from the page
extract()
grabs structured text from the current page using structured schemas. Given instructions and schema
, you will receive structured data.
extract
call might look for a single object:
z.string().url()
.
In Python, you’ll need to define it as HttpUrl
.extract
call might look for extracting a link or URL.
extract
call might look for a list of objects.
ExtractOptions<T extends z.AnyZodObject>
iframes: true
if the extraction content exists within an iframe.extract
will only process
the contents of the HTML element that the xpath points to. Useful for reducing input tokens and increasing extraction
accuracy.ClientOptions
.Promise<ExtractResult<T extends z.AnyZodObject>>
schema
.