so i am trying to manipulate with table on this website.
my script i insert in the chrome/firefox console on the website:
let skins = [
"button" //simplified
];
skins.forEach((skin)=>{
document.querySelector("tbody").childNodes.forEach((k,i)=>{
if(i>0){ // starts with 1 because i==0 is #text
console.log(k.childNodes[1].textContent); // this works in chrome,firefox
let h = k.childNodes[1].textContent;
if(h == "shades") console.log("yes"); // this part doesnt work - error
}
})
});
when i console.log it, it does work, and show all the <tr> on position 1. But when i try to do some code with if statement, the error message shows up,
Cannot read properties of undefined (reading 'textContent')
at <anonymous>:11:30
at NodeList.forEach (<anonymous>)
at <anonymous>:8:44
at Array.forEach (<anonymous>)
at <anonymous>:6:7