# Scroll

Source: https://docs.scrappey.com/docs/scroll

> Perform a scrolling action either to a specific element or to the bottom of the page — useful for loading dynamic content or triggering lazy-loaded elements.

## Command

`"scroll"`

Use this command to simulate user-like scrolling behavior during scraping or automation.

## Parameters

| Parameter | Type | Required | Description |
| ------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------ |
| `cssSelector` | string | No | The CSS selector of the element to scroll to. If omitted, the page will scroll to the bottom by default. |
| `repeat` | number | No | Number of times to repeat the scroll. This enables infinite scrolling behavior. |
| `delayMs` | number | No | Delay between each scroll in milliseconds — useful for waiting on content to load between scrolls. |

## Example

```bash
curl -X POST "https://publisher.scrappey.com/api/v1?key=YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "cmd": "request.get",
    "url": "https://example.com",
    "browserActions": [
      {
        "type": "scroll",
        "cssSelector": "#bottomElement",
        "repeat": 3,
        "delayMs": 1000
      }
    ]
  }'
```

## Notes

Use Case Ideas:

* Load more search results on websites with infinite scroll.
* Trigger lazy-loaded images or content blocks.
* Scroll to a form or button before interacting with it (e.g., clicking or typing).

Tips:

* Combine with `waitForSelector` after scroll to ensure the element has loaded before scraping.
* Use high `repeat` counts + delay for deep content loading.
* Can be combined with `if` or `while` browser actions for intelligent scrolling.

## Related concepts

Go deeper in the [Scrappey knowledge base](https://scrappey.com/qa):

- [Scraping infinite-scroll pages](https://scrappey.com/qa/web-scraping-apis/how-to-scrape-infinite-scroll-pages) — loading content as you scroll
- [Dynamic content scraping](https://scrappey.com/qa/web-automation/dynamic-content-scraping) — working with interactive pages
