# Infinitely Scroll an E-commerce Site

*The following example is a request we've prebuilt to show you Gaffa's capabilities on our* [*demo site.*](https://demo.gaffa.dev) ***You can run this request right now in the*** [***Gaffa API Playground***](https://gaffa.dev/dashboard/playground?templateId=infinite_scroll)***.***

Gaffa automates infinite scrolling on dynamic pages, such as e-commerce storefronts. Set a duration, and Gaffa will capture all content as it scrolls. Each session can be recorded as a video for playback, letting you debug or review the interaction.

## API Request

The request below uses the [POST endpoint](https://gaffa.dev/docs/api-reference/post-v1-browser-requests) to open the demo site in the e-commerce site simulator, featuring an infinitely scrolling storefront. It will wait for and dismiss a dialog box, wait for a product to load, and then scroll down the page for a maximum of 20 seconds - if new items load, it will keep scrolling.

```json
{
  "url": "https://demo.gaffa.dev/simulate/ecommerce?loadTime=3&showModal=true&modalDelay=0&itemCount=infinite",
  "proxy_location": null,
  "async": false,
  "max_cache_age": 0,
  "settings": {
    "record_request": true,
    "actions": [
      {
        "type": "wait",
        "selector": "div[role=\"dialog\"]",
        "timeout": 10000
      },
      {
        "type": "click",
        "selector": "[data-testid=\"accept-all-button\"]"
      },
      {
        "type": "wait",
        "selector": "[data-testid^=\"product-1\"]",
        "timeout": 5000
      },
      {
        "type": "scroll",
        "percentage": 100,
        "max_scroll_time": 20000
      }
    ]
  }
}
```

## Actions

{% content-ref url="../actions/wait" %}
[wait](https://gaffa.dev/docs/features/browser-requests/actions/wait)
{% endcontent-ref %}

{% content-ref url="../actions/click" %}
[click](https://gaffa.dev/docs/features/browser-requests/actions/click)
{% endcontent-ref %}

{% content-ref url="../actions/scroll" %}
[scroll](https://gaffa.dev/docs/features/browser-requests/actions/scroll)
{% endcontent-ref %}

## Response

Here's a video showing Gaffa scrolling the page for 20 seconds as more items load.

{% embed url="<https://youtu.be/s4WsBYxGWOo>" %}
Gaffa scrolling to the bottom of a simulated ecommerce page!
{% endembed %}

## Read More

Read more about screen recording here. (TODO)

{% content-ref url="../../../get-started" %}
[get-started](https://gaffa.dev/docs/get-started)
{% endcontent-ref %}
