CP3O
CP3O

Reputation: 429

How to create a script that clicks on all follow buttons on a behance page?

How does one go about this ? Behance has discover pages and follower pages, that may contain a few thousand users. Each user has a follow button. Clicking each one individually is crazy.

This is the button in case that helps.

<a class="form-button form-button-follow form-button-small form-button-default form-button-left-icon form-button-icon-follow">
   Follow  
</a>

Upvotes: 0

Views: 1432

Answers (2)

Richard Dalton
Richard Dalton

Reputation: 35793

If the links are handled with javascript and submit ajax requests then you can just manually trigger a click on all of them like so:

$('.form-button-icon-follow').click();

However, if these follow links do a full postback (page refreshes) then this will not work as it will refresh the page as soon as the first link is 'clicked'. In that case you might need to see what data is actually posted to the server and you might be able to create your own ajax requests to use instead.

Upvotes: 1

laaposto
laaposto

Reputation: 12213

Try

$( '.form-button-follow' ).click ();

It trigger a click event on selected elements.

More

Upvotes: 1

Related Questions