Automatically scrolls through infinite scroll content by repeatedly scrolling to the bottom
until no new content loads or maximum scroll limit is reached.
from typing import TypedDictfrom playwright.async_api import Pagefrom intuned_browser import scroll_to_load_contentclass Params(TypedDict): passasync def automation(page: Page, params: Params, **_kwargs): # Scroll through entire page content await page.goto("https://sandbox.intuned.dev/infinite-scroll") await scroll_to_load_content( source=page, ) # Will keep scrolling until the page has loaded all content or the max_scrolls is reached.
Minimum height change in pixels required to continue scrolling. Defaults to 100. If the page has loaded all content and we still haven’t reached the max_scrolls, the min_height_change will detect that no new content is loaded and stop the scrolling.