Skip to content

How to use ascraper_playwright_scroll for pagination #984

@zymmlalala

Description

@zymmlalala

How to use ascraper_playwright_scroll for pagination? Here, when I configure backend=playwright_scroll, I encounter an error at the location of dynamic_import(backend, message). I would like to know how to solve this problem.

Activity

dosubot

dosubot commented on Jun 12, 2025

@dosubot

Hi @zymmlalala! I'm Dosu and I’m helping the Scrapegraph-ai team.

The error happens because backend="playwright_scroll" is not a valid module name—only "playwright" or "selenium" are supported backends. To use scrolling and pagination, set backend="playwright" and then use the ascrape_playwright_scroll method, which is designed for this purpose. This method lets you control how far and how long to scroll, and whether to scroll to the bottom or for a set time. Make sure you have the playwright package installed.

Example usage:

loader = ChromiumLoader(
    urls=[your_url],
    backend="playwright",
    headless=True,
    browser_name="chromium",
)
html = await loader.ascrape_playwright_scroll(
    url=your_url,
    timeout=30,           # seconds to scroll
    scroll=15000,         # pixels per scroll
    sleep=2,              # seconds to wait after each scroll
    scroll_to_bottom=True # set to True to scroll until the page stops changing
)

You can adjust timeout, scroll, and sleep to fit your pagination needs. The scrolling logic is built into the ascrape_playwright_scroll method, so you don't need a special backend for it—just use "playwright" as the backend and call the method as shown above.
Reference: ChromiumLoader and ascrape_playwright_scroll implementation

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Join Discord Share on X

added
bugSomething isn't working
questionFurther information is requested
on Jun 12, 2025
added
staleIssue has not had recent activity or appears to be solved. Stale issues will be automatically closed
on Sep 11, 2025
removed
staleIssue has not had recent activity or appears to be solved. Stale issues will be automatically closed
on Sep 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @zymmlalala

        Issue actions

          How to use ascraper_playwright_scroll for pagination · Issue #984 · ScrapeGraphAI/Scrapegraph-ai