Puppeteer
Getting React / Vue pages
It's probably because the contents of rest of those elements are loaded dynamically with a Javascript framework like React or Vue. This means that it only gets loaded when those elements enter the viewport of the browser.
To fix this you will need to write a function that auto scrolls the page so that those elements can get into the viewport and then you have to wait for that function to finish before you collect the data.
The scrolling function:
Then call this function after page.goto()
and before you grab the content with page.content()
. I also set the viewport width and height then the scrolling goes a little faster:
Last updated