I am trying to loop through all the links on a site and autoclick some links in order to vote for here is what I have so far:
function x(){
for(var e in document.getElementsByTagName("a")){
alert(e.getAttribute("href"))
e.click;
}
}
This currently does not work I think it maybe to do with something simple like the braces/; key, I'm an absolute beginner to javascript so please bear with me. I assume you get the drift of what I want to do, I have completed this task in another language but still did not get the vote to register, I believe this maybe something to do with the site using jquery? My question is, How can I get this simple script working for a start, and 2) Is there a different click method for Jquery I can use instead of what I have up there 3) How Can I check for 6 specific URLs and click only these. I also need to execute this from the browser using javascript:xxx_code_here
Any ideas?
Thank you
use jquery like
$("a").each(function ()
{
$(this).trigger('click');//for clicking element
var href = $(this).attr("href");
});
You can use trigger:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With