Puppeteer (nodejs package): need help understanding page.evaluate & elementHandle.evaluate
Hello,
Learning nodejs' puppeteer package for webscraping right now.
Please, correct me, if I'm wrong: I believe evaluate, takes in a pageFunction, runs it against the calling object. The point of having those functions in those classes is that we can access members of that object in our callback and perform work with it (e.g. . Am I right on all of that ?
I checked out their docs (https://devdocs.io/puppeteer/), again and again, and I'm wondering, is there a difference between the two: page.evaluate and elementHandle.evaluate ?
I do know that Page represents a page on a browser, and an elementHandle represents an in-page DOM element. But do they just both have the same implementation of evaluate? On different data structures?
Thank you
0 Replies