I'm working on a script made for a forum. The forum consists of several pages, and every page on the forum looks like this:
www.blabla.com/forum#p1
www.blabla.com/forum#p2
www.blabla.com/forum#p3
...
www.blabla.com/forum#p220
In my script, I have to find a specific URL on page 220, and if it's there, open it. The problem is, opening the link didn't seem to work like i want it to:
var elem = document.getElementsByClassName("all_items"),
i = 0;
if (elem[i].href.indexOf("www.blabla.com/item220") === 0)
{
window.open(elem[i].href, "_blank");
}
What I'm doing here is: I first define all items on the page by their class, and then ask it to cycle through items until it finds the link of "item220" and opens it.
Problem: The only elements and links that figure inside the source code of this website, are those of page 1. As a result, my script can't find "www.blabla.com/item220" because this isn't on page 1, and therefore also not in the source code. Though, in the "inspect element" menu, I can indeed find the link of item220.
How do I find a link which doesn't exist in the source code but does appear inside the "inspect element" menu?
Thanks for helping me out,
-Bram