I want to get multiple html elements with puppeteer from dynamic website.
But when I only get first element.
How to get all elements?
const puppeteer = require("puppeteer-core");
browser = await puppeteer.launch({
executablePath:
"./node_modules/chromium/lib/chromium/chrome-mac/Chromium.app/Contents/MacOS/Chromium",
});
const element = await page.waitForSelector(
".MuiTableRow-root.MuiTableRow-hover.css-1tq71ky"
);
const value = await element.evaluate((el) => el.textContent);
console.log(value);
await browser.close();
I had a similar issue and i solved it with a loop, something like this:
for(const single of element){
const value = await single.evaluate((el) => el.textContent);
console.log(value);
}