puppeteer / examples

Use case-driven examples for using Puppeteer and headless chrome

Home Page:https://developers.google.com/web/tools/puppeteer/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to know when the network is idle (not on loading)

eduardosada opened this issue · comments

Hi @ebidel

Could you tell me why is this line commented?

https://github.com/GoogleChromeLabs/puppeteer-examples/blob/59355609ecb3c2e396a289b28f34d5116fc89b8e/lazyimages_without_scroll_events.js#L97

I would like to know if it's possible to know when the network is idle.

I think I was experimenting. await page.goto(url, {waitUntil: 'networkidle2'}); should wait for the page to load and network to be idle. For this script, I was seeing some resources lazy loaded well after the page navigation was complete. I wanted to catch those too, hence the additional page.waitFor after the page.goto.