extractRules
parameter to extract specific content from the page using CSS selectors. This is useful when you want structured JSON output without parsing raw HTML manually.
The value is a simple object where each key is the name of the field you want, and the value is the CSS selector used to extract it.
Use
extractRules
when you need fast, lightweight structured data without running a full AI model.Format
Example: Extract Page Title
<h1>
on the page and returns it under the title
key.
Example: Extract Multiple Fields
Attribute Extraction
You can extract an attribute by using@attribute
syntax:
Notes
- Only the first match per selector is returned
- If the selector is not found, the value will be
null