Created
June 20, 2024 15:15
-
-
Save acoyfellow/058fbb5f8ad6436f8330d4439a8deab9 to your computer and use it in GitHub Desktop.
LinkedIn Auto follow w/ pagination
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function autoFollow() { | |
const buttons = document.querySelectorAll("[aria-label*='Invite']"); | |
for (let i = 0; i < buttons.length; i++) { | |
buttons[i].click(); | |
await new Promise(resolve => setTimeout(resolve, 200)); | |
const sendButton = document.querySelector("[aria-label='Send without a note']"); | |
if (sendButton) { | |
sendButton.click(); | |
} | |
await new Promise(resolve => setTimeout(resolve, 1000)); | |
} | |
// Wait for all invites to be sent | |
await new Promise(resolve => setTimeout(resolve, 5000)); // Wait for 5 seconds | |
// Click the "Next" button | |
const nextButton = document.querySelector("[aria-label='Next']"); | |
if (nextButton) { | |
nextButton.click(); | |
// Wait for the next page to load | |
await new Promise(resolve => setTimeout(resolve, 5000)); // Wait for 5 seconds | |
// Run the autoFollow function again | |
autoFollow(); | |
} | |
} | |
// Start the process | |
autoFollow(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment