page.$$eval() not working as expected (Puppeteer)

In a page, there are bunch of elements which a specific class.

The below code doesn’t print the no. of elements:

await page.$$eval(scoreSelector, (ele) => {
    console.log(ele.length);

Whereas, this works as expected:

curLiveScoreElements = await page.$$(scoreSelector)

Please clarify.

1 thought on “page.$$eval() not working as expected (Puppeteer)”

Leave a Comment