Skip to content

Instantly share code, notes, and snippets.

@M-ZubairAhmed
Created November 26, 2020 03:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save M-ZubairAhmed/27350f588413e90cdc199d94d4d7667c to your computer and use it in GitHub Desktop.
Save M-ZubairAhmed/27350f588413e90cdc199d94d4d7667c to your computer and use it in GitHub Desktop.
Connect to all Linkedin connection on a page with js
// Edit the classname of the connect button on Linkedin
const connectButtonClassname = "full-width artdeco-button artdeco-button--2 artdeco-button--full artdeco-button--secondary ember-view"
const allButtons = document.getElementsByClassName(connectButtonClassname)
const allButtonsArray = Array.from(allButtons)
if (allButtonsArray.length > 0){
allButtonsArray.forEach(function(button){
if (button.innerText === "Connect"){
button.click()
}
})
}
@M-ZubairAhmed
Copy link
Author

M-ZubairAhmed commented May 11, 2021

Use it carefully as misuse might render you as a 'bot' by linkedin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment