I am developing a web scrapping and I am trying to solve latest problems with this.
In this case I need to check if innerText is null inside loop.
for(var j = 0; j<linkPlayersNew.length;j++){
var stats = [];
for (let i = 2; i <= 23; i++) {
const values = await page.evaluate((nth,nth2) => {
const test= parseInt(nth);
const test2= parseInt(nth2);
return document.querySelector('div.ui-table__row:nth-child('+test2+') > div:nth-child('+test+')').innerText;
},i,j+1);
stats.push(values);
}
data.push(stats);
}
console.log(data);
This works correct but I need to check if innerText is not null inside loop.