I have a function:
const tableData = await page.evaluate(() => {
const tds = Array.from(document.querySelectorAll('table tbody tr td'))
for (var i = 0; i < tds.length; i++) {
...
...
availableDates.push([i,dateString,day])
}
return availableDates
}
and this function cycles all cells of a table and I filter based on some conditions some dates out of there.
So far so good. The cells contain a href which I want to click. The array holds the number of the cell which I want to click on the first array item and so I have tried:
await page.focus('table tbody tr td:nth-child('+tableData[0][0]+') a' )
await page.keyboard.type('\n');
but without luck. I get the following error message:
(node:81325) UnhandledPromiseRejectionWarning: Error: No node found for selector: table tbody tr td:nth-child(109) a
.......
What must I change? Thanks.