Apify Discord Mirror

Updated 5 months ago

How to set the timeout?

At a glance

The community member is asking how to set different timeouts for navigation and other methods when using Playwright with the Crawlee library. They mention that Playwright allows setting the default timeout for all methods using browserContext.setDefaultTimeout(timeout), and a separate timeout for navigations using browserContext.setDefaultNavigationTimeout(timeout). The community member asks if they can achieve similar functionality with Crawlee/Playwright, and specifically mentions the navigationTimeoutSecs option.

In the comments, another community member confirms that yes, you can use the navigationTimeoutSecs option with the Crawlee/Playwright integration.

Useful resources
With Playwright, It is possible to set the timeout for every method that accepts the timeout setting using: browserContext.setDefaultTimeout(timeout)
If you want a different timeout for navigations than other methods, perhaps when simulating slow connection speeds, you can also set: browserContext.setDefaultNavigationTimeout(timeout)

How can I do this with crawlee/playwright?

Can I use navigationTimeoutSecs? (https://crawlee.dev/api/playwright-crawler/interface/PlaywrightCrawlerOptions#navigationTimeoutSecs)
A
1 comment
yes, you can, crawler is extended "browser context"
Add a reply
Sign up and join the conversation on Discord