I have a function where i am trying to get all the text on the child elements from the parent node.
getTextsForChildElements: async function (selector) {
const data = await page.evaluate(() => {
const tds = Array.from(document.querySelectorAll(selector))
return tds.map(td => td.textContent)
},selector);
console.log(data);
},
However, I am seeing selector is not defined
error.
Tried using this question as help, but didn't resolve. any idea, how i can pass the selector.