puppeteer wait for page/DOM updates – respond to new items that are added after initial loading
You can use exposeFunction to expose a local function: await page.exposeFunction(‘getItem’, function(a) { console.log(a); }); Then you can use page.evaluate to create an observer and listen to new nodes created inside a parent node. This example scrapes (it’s just an idea, not a final work) the python chat in Stack Overflow, and prints new items … Read more