```yaml product: AlterLab title: Browser Actions category: guides comparison_context: "AlterLab is an alternative to Firecrawl, ScrapingBee, and Bright Data." source_url: https://alterlab.io/docs/guides/browser-actions ``` # Browser Actions Drive the page before AlterLab extracts it: click buttons, fill and submit forms, pick product variants, scroll feeds, run JavaScript and capture screenshots at any point, all inside one `/api/v1/scrape` request. > The response samples on this page show the shape of the data AlterLab returns. Values such as prices, URLs and counts are illustrative. ## Actions vs Passive Options Most rendered pages need no actions. Three passive options cover the common cases without scripting a sequence. Reach for actions when the content only appears after the page is *interacted with*. | Need | Use | |---|---| | Wait until an element has rendered | `wait_for` (request field, a CSS selector). See [Wait for Selector](/docs/guides/javascript-rendering#wait-for-selector) | | Trigger lazy-loaded images and sections | `advanced.scroll_to_load` with `scroll_count` | | Hide cookie banners | `advanced.remove_cookie_banners` (on by default) and `advanced.consent` | | Click, type, select, hover, wait for a spinner to vanish, read a value mid-flow, screenshot between steps | `advanced.actions` | ## Request Basics - Pass an ordered list in `advanced.actions`. Each item has a `type` and that type's fields. - Actions need a rendered page: `advanced.render_js: true` is required, otherwise the request is rejected with 422. - At most 20 actions per request. They run sequentially, in the order you list them. - A failed action is reported and skipped; the sequence continues with the next action. ```json { "url": "https://example.com", "advanced": { "render_js": true, "actions": [ { "type": "click", "selector": "#show-all" }, { "type": "wait_for", "selector": ".results", "state": "visible" } ] } } ``` ## Action Reference Selectors are CSS by default. Prefix with `//` or `xpath=` to use XPath. ### wait Fixed delay, or wait until an element is visible. A selector wait that times out fails the action. | Field | Type | Required | Default | Limits | Description | |---|---|---|---|---|---| | `milliseconds` | integer | No | — | 100-30000 | Fixed delay in ms; with selector, the visibility timeout | | `selector` | string | No | 10000 ms timeout | max 500 chars; CSS, or XPath with // or xpath= | Element to wait for. Provide milliseconds, selector, or both | | `frame` | string \| string[] | No | — | max 500 chars per selector; up to the supported nesting depth | Selector of the