Skip to content

can't set PLAYWRIGHT_DEFAULT_NAVIGATION_TIMEOUT to 0 #47

@JustinQHu

Description

@JustinQHu

BY default, playwright has a timeout of 30 seconds for a lot of its behaviors, including:
image

You can set 0 to disable timeout for these actions in playwright, referring to Playwright API reference

Current code(line 68, scrape_playwright/hander.py) doesn't work when the value is 0:
self.default_navigation_timeout: Optional[int] = ( crawler.settings.getint("PLAYWRIGHT_DEFAULT_NAVIGATION_TIMEOUT") or None )

As you can see, then PLAYWRIGHT_DEFAULT_NAVIGATION_TIMEOUT is 0, the value of this expression is still None, for

0 or None

is still None in Python.

Rightnow, I just subclass ScrapyPlaywrightDownloadHandler to work around this issue.

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions