Skip to content

Conditional wait #106

@AlvinSartorTrityum

Description

@AlvinSartorTrityum

Hi! Thanks for the plugin, it's very useful.

I generally use the PageMethod("wait_for_load_state", "networkidle") to know when a page has done loading, but I encountered a site that keeps doing requests in the background, so I get a timeout error.

On normal playwright I'd handle the situation like this:

  await page.goto(url);
  await Promise.race([
    page.waitForLoadState("networkidle"),
    page.waitForTimeout(25),
  ]);

So to wait for networkidle OR 25 seconds.

Is it possible to do so with scrapy-playwright?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions