I recently developed a Chrome extension that scrapes all orders from an eBay orders page. It was working flawlessly last month, but suddenly I am facing issues accessing some elements.
Here is the snippet of code causing trouble: let elGridComp = document.getElementsByClassName("table-grid-component"); let elOrders = elGridComp[0].childNodes[2].childNodes; //elOrders contains multiple elements (105 in this case)
Trying to access classes using getAttribute(): elOrders[0].getAttribute("class");//works
However, elOrders[2].getAttribute("class");//throws an exception
For example, when trying elOrders 0,1,3,5 it returns the class attribute fine, but for 2, 4 and 7 it throws an exception: Uncaught TypeError: elOrders[i].getAttribute is not a function. See attached photo showing some of the first elements in elOrders https://i.sstatic.net/ki2of.png
Thank you