0

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.

varjoll
  • 29
  • 5

2 Answers2

2

Nevermind,

page.waitFor(2000)

does exactly what I want.

varjoll
  • 29
  • 5
0

The equivalent of time.sleep in asynchronous is asyncio.sleep. So use:

await asyncio.sleep(2)  # 2 second non-blocking sleep
Faizan AlHassan
  • 389
  • 4
  • 8