0

I am having a page with many button's , I have to Click on each button to Activate a user which takes a lot of time . I was wondering if Is it possible to invoke a link through Firefox / Chrome console ?

For instance suppose there is a Class

<a class="Button" href="#" link="/info.php?code=379645838760724 id="uqyiqh_25">
<span class="ButtonText">Click Here to activate user Greg</span></a>

I want to fire the link part of the tag with the help of console ? Can I use the Console to select this ID and Call the Link ?

Yahoo
  • 4,093
  • 17
  • 59
  • 85
  • If a `GET` at that link will activate the user you could dump the page source to a file, perform a little regexp magic to extract the links, then feed them to a batch process using `wget` or `curl` – Stephen P Jun 08 '12 at 21:22
  • Why is the url in a link attribute? And you're missing the terminating `"` – Cameron Martin Jun 08 '12 at 21:29

1 Answers1

2
var elements = document.getElementsByClassName('Button');
for (var i = 0; i < elements.length; i++) {  
  var request = new XMLHttpRequest();  
  request.open('GET', elements[i].href, true);
  request.send();
}
Cameron Martin
  • 5,952
  • 2
  • 40
  • 53