Dear everybody I have a problem with selector in puppeter.
I have this code.
for(var k= 0 ; k<= 21 ; k++) {
const text = await page.evaluate(() => {
document.querySelector(
'div.ui-table__row:nth-child('+k+') > a:nth-child(1) > div:nth-child(2)'
).textContent
})
console.log(text);
}
The problem when I try to execute this snippet is that I don't have defined k but i think that is correct.
Error: Evaluation failed: ReferenceError: k is not defined
How I can solve this problem ? Regards