I have a webpage page full of links, with check boxes next to them showing that I've clicked them. There are hundreds of links, and I would rather not click through all of them. What I would like to do is write a script that performs a "click" on each of the links, so that I don't have to.
var links = document.getElementsByClassName("some-class");
for(var i = 0; i < links.length; i++) {
links[i].click();
}
My code simply opens the first link and navigates away from the original page, which of course stops execution of the code.
Can Javascript open links without navigating to them, such as in a new window or tab? If not, with what language can this be scripted?
links[i].target = "_blank";before the line where you.click()? Or JS can get the URL from each element'shrefproperty and usewindow.open()with that URL.