Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to select innerHTML from an elementHandle in puppeteer

Using the node puppeteer module, how do I continue with this code to get the innerContent here?

const els = Promise.all(await page.$$(selector)).then(results => {
    results.map(async el => {
      const tr = await el.$('tr')
      //How do I convert this element handle to get its innerText content?
         })
     })
like image 213
ReduxDJ Avatar asked Nov 16 '25 16:11

ReduxDJ


1 Answers

Like this

textValue = tr.getProperty('innerText').jsonValue()
like image 131
Imran Younas Avatar answered Nov 18 '25 05:11

Imran Younas