Skip to main content

Iterating through child elements in puppeteer returns undefined

I'm a beginner with puppeteer and sorry if my question sounds dumb or I missed something. But when I try iterating through the parents node children elements and trying to get its innerText (that does exist) it returns undefined?

let Atsiskaitymai = await page.$$("#slenkanti_dalis > table > tbody > tr")

for (atsiskaitymas1 of Atsiskaitymai) {
  let s = await atsiskaitymas1.evaluate(x => Object.values(x.children))
  for (let i of s) {
    console.log(i.innerText); 
  }
  //returns undefined

Thank you for anyone's help.

Tried to do:

i.evaluate(x => x.innertext)
i.getAttribute('innerText')
Via Active questions tagged javascript - Stack Overflow https://ift.tt/vnsRy1B

Comments