For the complete documentation index, see llms.txt. This page is also available as Markdown.

Infinitely Scroll an E-commerce Site

An example request that uses Gaffa to infinitely scroll down a simulated ecommerce site whilst recording the interaction.

The following example is a request we've prebuilt to show you Gaffa's capabilities on our demo site. You can run this request right now in the Gaffa API Playground.

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 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.

{
  "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

WaitClickScroll

Response

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

Gaffa scrolling to the bottom of a simulated ecommerce page!

Read More

Read more about screen recording here. (TODO)

Get Started

Last updated