Adaptive Selectors
Relocate CSS selectors when markup drifts, collect similar cards, and generate a CSS path for the next run.
What adaptive selectors can do
When a CSS selector no longer matches after a deploy, Scout searches by classes, IDs, and text. similar collects card-like siblings; selector returns a generated CSS path.
- adaptive + match_text on extract fields and assert rules
- selector_relocations[] shows from → to
- type: similar for lists/cards
- type: selector generates a CSS path for monitoring
Endpoints & parameters
Choose an endpoint — below you'll see an example request and explanations for all relevant parameters.
POST /v1/extract
Fields with relocation, similar lists, and generated path.
Example request
{
"url": "https://shop.example/pricing",
"fields": [
{
"name": "cta",
"selector": "a.btn-primary",
"type": "text",
"adaptive": true,
"match_text": "Buy"
},
{
"name": "cards",
"selector": "article.plan",
"type": "similar"
},
{
"name": "cta_path",
"selector": "a.btn-primary",
"type": "selector"
}
]
}Parameters
urlstring requiredTarget URL.
fields[].adaptivebooleanRe-resolve selector when it is missing.
fields[].match_textstringText hint for relocation.
fields[].typeenumsimilar = sibling cards, selector = CSS path.
dismiss_cookie_bannerbooleanAttempts to dismiss known cookie banners before measuring or checking.
wait_for_selectorstringWaits for a CSS selector before continuing.
wait_ms / settle_msnumberAdditional wait time after loading (depends on endpoint).
devicestringPlaywright device preset; overrides width/height/UA when set.
color_scheme'light'|'dark'|'no-preference'Preferred color scheme in the browser.
block_adsbooleanBlocks known ad and tracker requests.
capture_xhrstringGlob or substring for XHR/fetch URLs whose bodies Scout captures (max. 20).
fetch_mode'browser'|'http'http loads without JavaScript (static document). Default: browser.
solve_captchabooleanBest-effort Turnstile/checkbox on your own sites. Cloud: domain verify. Self-host: always allowed.
record_harbooleanOptionally records HAR (where supported by the endpoint).
respect_robotsbooleanRespect robots.txt (default: on).