Selector Rules
A CSS selector narrows Detector's comparison to one region of the page. Everything outside the selector is ignored entirely: menus, the footer, the cookie banner, side rails. That is both the point of a selector and its risk; if the site restructures and the selector stops matching, the check fails loudly instead of silently reporting "no changes".
Supported Selector Forms
Detector renders the page in a browser and then applies the selector with standard querySelectorAll rules. If several elements match, they are joined in document order and compared as a single region.
| Selector | Example | When to use it |
|---|---|---|
| #id | #pricing-table | A single region with a stable id |
| [data-*] | [data-testid="terms-body"] | Test attributes; the most robust option across redesigns |
| tag tag | main article | Pages with clean semantic structure |
| .class | .product-price | Only if the class names are not generated (hashed) |
| a, b | #price, #stock | Watching a few separate regions together |
Position-based selectors such as :nth-child() also work, but they slide to the wrong region as soon as one element is added to the page; avoid them where you can.
Updating a Selector with the API
When you change the selector of an existing monitor, Detector fetches the new region right away and stores it as the new accepted version, so a selector change does not produce a notification on its own.
curl -X PATCH https://api.incapon.com/v2.4/detector/monitors/mon_8f2c \
-H "Authorization: Bearer $INCAPON_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"selector": "[data-testid=\"terms-body\"]"}'When a Selector Does Not Match
If the selector matches zero elements, the check is marked failing with the error code selector_not_found and retried on the next interval. After three consecutive failures the monitor.failed event is sent and the monitor is paused. Failed checks are billed too, because the page was still fetched and rendered.
Detector never silently keeps running a monitor that has lost its selector. That way you do not miss a price change when a site is redesigned; keeping the selector current is your responsibility, though.
Selector Tips
The Preview screen in the dashboard highlights the region the selector matches. Check that the right region is selected before you save.
Select the price table, not the price cell; single-cell selectors break when the table is reordered.
Classes produced by build tools, such as .css-1x9k2a, change with every deploy. Prefer an id or a data-* attribute.
If a carousel still rotates inside the region, add an ignore rule instead of narrowing the selector further.