wait_for
Wait for a text, CSS selector, or JavaScript condition to be met on the page, then return a snapshot of the current state.
Instructions
Wait for a condition on the page: text content, a CSS selector, or a JS predicate. Returns a snapshot once the condition is met. At least one condition (text, selector, or predicate) must be provided.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | No | List of texts. Resolves when any value appears in the page body. | |
| timeout | No | Timeout in milliseconds. Default is 30000. | |
| visible | No | When true and selector is set, waits for the element to be visible (not just present in DOM). Default is false. | |
| selector | No | CSS selector. Resolves when a matching element exists in the DOM. | |
| predicate | No | A JavaScript expression that must return a truthy value. Example: "document.querySelectorAll('.item').length >= 5" |