I'm trying to trigger a click on multiple elements with the same class but when i do so the first element only get clicked and not the others, frankly I'm trying to make likes to all ask.fm profile answers by using the console of firefox so this is what i did
$('.like').trigger('click');
but i realized that only the first element (answer) get clicked so i did something else
$('.like').each(function(){$(this).trigger('click');})
but the problem still exist, os what am i doing wrong here !!
Edit: The html code
all answers got this element in it
<a class="like hintable" hint="Like" href="#" onclick="Like.quickLike(128332156539, "mo7am_rs", "/likes/am77r/question/128332156539/add"); return false;" style="display:block"></a>
and i want to click this element in all answers element
Frankly I'm trying to make likes to all ask.fm profile answers
Your code should work, so, probably they're ignoring/blocking two too consecutive clicks to prevent bots and missclicks.
A workaround to this would be adding a sleep to it (you should adjust the sleep value, because it depends on their secret configured threshold).
The following code would try a click after each 10 seconds:
var sleep = 0;
$('.like').each(function(){
var likeElement = $(this);
setTimeout(function() {
likeElement.trigger('click');
}, sleep);
sleep += 10000;
});
Please, also verify if that practice is compliant to the site's policy.
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