Is there something like document.ready() in Puppeteer?
There is:
page.waitForSelector(selector)
Since there are so many same-name selector on any HTML page, how can this function can be sure that the right page has been loaded? It is a simple function, but caused quite a few errors when I use it before page.content(). I'm not sure what is missed about this function.