Reputation: 29
I have a pyppeteer (not puppeteer) browser with many pages opened, and I'd like to wait for example 2 second before doing other stuff on some of these pages. I tried to use time.sleep() but it looks like it blocks the execution of all pages.
Is there an equivalent to page.waitForTimeout() in pyppeteer ? I think I could also use multithreading but I'd like not to.
Upvotes: 0
Views: 1802
Reputation: 429
The equivalent of time.sleep
in asynchronous is asyncio.sleep
. So use:
await asyncio.sleep(2) # 2 second non-blocking sleep
Upvotes: 0