I am working on creating a chrome extension for an ESPN fantasy league page.
Essentially, wherever there is a link of a players name, I want it to also link to a new tab of a different site. That is mostly irrelevant, as what I am having issue with is gathering the links into an array in the first place.
Using javascript:
window.addEventListener('load', function () {
console.log("Test 1");
var links = document.getElementsByClassName('link clr-link pointer');
console.log(links.length);
for (elt of links){
console.log(links.text);
}
console.log("Test 2");
});
The page is a league page so its going to be private, but here is a screenshot of the DOM:
So I am looking for all links with the class attribute of "link clr-link pointer"
In my console, the code is running after the DOM loads but is returning an array of size 0, despite every player link being of that same class:
Any idea why it isn't grabbing any of the links? Thanks in advance for any help.