Connecting to a Lot of People on LinkedIn via Browser DevTools - Justin Ribeiro, Ph.D.
I don’t hide my distaste for what LinkedIn has become; a long time ago, it was a nice address book compliment and now it lives under the zombie section of my graveyard. People ask “are you on LinkedIn?” and I respond “sure, if you consider Perl scripts run via cron being ‘on’ LinkedIn”. These people look at me with that sort of forced smile one makes when you don’t know what the person just said, the person not really caring but they’re trying to be nice and are just trying to meet you somewhere in the virtual space. Frankly, I understand—well adjusted people don’t automate their human interactions.
Then again, research has started to tell a more specific story around a LinkedIn user’s current use model and why people keep asking to connect. For one, a user’s follower count—unsurprisingly—predicts engagement on LinkedIn (Usera & Durham, 2025) and we know that the relationship is curvilinear (Jain & Jain, 2023). The follower count becomes the social hub, increasing the ability to find customers or a job (Kupfer et al., 2018) and potentially build credibility (Santee, 2024).
In the dystopian sphere of job losses and ever-changing global economic conditions, none of this I find surprising. We seek to better our odds, however we can.
But I still don’t care for LinkedIn. So let’s game it.
If follower count is such a strong predictor—there are others by the way in that paper, I’m just focusing on this to begin—we need those sweet sweet connections. But who has the time to click buttons? I know I don’t.
Enter your browser’s DevTools, the thing every infosec training you’ve ever had tells you to never open let alone paste code into. You can break all the rules! I still love DevTools even though I don’t work on the finer parts anymore—well, not publicly at least—it gives you the means to do what you want to your data, and in this case, other people’s.
If we do a little peeking at their code, their page code looks mighty complex and twisted mess of divs and spans, the weight of JavaScript frameworks that would make Alex flip a table over—rightfully so, I help flip those tables at every chance. While the code is an obfuscated mess, they have a tell: the aria-label, particularly its use of the word “Invite”. We just need to find that at the beginning of the attribute value, and wouldn’t you know it, the web platform allows us to do that with the ^= attribute selector.
With a bit of scrolling on the network page—really get in there, scroll scroll scroll—in the example screenshot below we find 371 invite buttons. You might find more!
Finding all the invite buttons on the Network page of LinkedIn; I have no idea who those people are.<br>Justin Ribeiro
Now we just need to click those buttons automatically, attempting to be mindful of the fact that LinkedIn is about to rate limit us on two levels: one, requests per second, and two, amount of connection requests you can send in a week.
//<br>// Justin needs friends or something, LinkedIn Edition<br>//<br>// This script does nothing more than invite people to connect en masse<br>//<br>// How to use:<br>// Step 1: Open Browser DevTools<br>// Step 2: Go to https://www.linkedin.com/mynetwork/grow/ or whatever the<br>// network link is, scroll until you load up some peeps on the page<br>// Step 3: Paste the script into the DevTools Console, hit Enter<br>// Step 4: Watch connection's fly out the door to people you likely don't know<br>//<br>// MIT License<br>// Copyright (c) 2026 Justin Ribeiro<br>//<br>function randomTimer(minDelay, maxDelay, callback) {<br>const delay = Math.floor(Math.random() * (maxDelay - minDelay + 1)) + minDelay;<br>setTimeout(() => {<br>callback();<br>randomTimer(minDelay, maxDelay, callback);<br>}, delay);<br>document.querySelectorAll("button[aria-label^='Invite']").forEach(b => {<br>randomTimer(2000, 15000, () => {<br>console.log('New friend found, the connect button has been clicked!');<br>b.click();<br>});<br>});
Now, will this script always work? Well, most of the time; you’ll hit the limit if you go connect-crazy and LinkedIn will throw errors (e.g., 429 codes mostly). Eventually LinkedIn will come back up and then you can do whatever it is you do with LinkedIn. Does LinkedIn allow this? I mean, I’m clicking buttons, but sure they probably do not, your mileage will vary, I provide this as-is under an MIT license, I take no responsibility, yada yada yada.
Am I one of the cool kids now? I already know the answer—if you have to ask, you’re not. Damn it.
References
Jain, P., & Jain, A. 2023. Evaluating the Impact of Influencer Following on the Level of Social Media Engagement, 2023.
Kupfer, A.-K., Pähler Vor Der Holte, N., Kübler, R. V., & Hennig-Thurau, T. 2018. The Role of the Partner Brand’s Social Media Power in Brand Alliances. Journal of Marketing, 82(3): 25–44.
Santee,...