I am trying to mass follow people i know without clicking connect the button.I have been trying to find a bit of code to mass connect through javascript console for example:
$('.button-text.follow-text').trigger('click');
Is this possible to do?
Thanks
Sure, you can, but its hard to help you with a concrete example without knowing which page you're looking at and what the underlying HTML is.
The following HTML resembles the output of the "People you may know" list on LinkedIn:
<ul class="people-cards-list">
<li id="card-1234" class="card pymk-card" data-unique-id="0">
<!-- ... contents -->
<button class="bt-request-buffed buffed-blue-bkg-1" title="Connect with ..."></button>
</li>
<li id="card-5678" class="card pymk-card" data-unique-id="1">
<li id="card-9012" class="card pymk-card" data-unique-id="2">
<!-- and so on -->
</ul>
You would be able to fire a click event on all the connect buttons from your console with this single line:
$('.people-cards-list button.bt-request-buffed').each(function (index, button) { button.click() });
It should be doable to rewrite this for use on the page you need it for.
Depending on the amount of people you want to connect with, it could be smart to add a timeout to prevent killing your browsers with hundreds of requests:
$('.people-cards-list button.bt-request-buffed').each(function (index, button) { setTimeout(function () { console.log(button); }, 500*index) });
Is this what you need?