Last active
May 29, 2024 17:16
-
-
Save laricko/25ae5a7d3ea0b2c105d9ca07cf8b4b74 to your computer and use it in GitHub Desktop.
Bulk connections delete from LinkedIn
This file contains 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
// Make sure to open LinkedIn Connections page | |
// and then run this script in the console. | |
async function deleteConnections(howMany) { | |
const delay = ms => new Promise(resolve => setTimeout(resolve, ms)); | |
const connectionButtons = Array.from(document.querySelectorAll('button.mn-connection-card__dropdown-trigger')).slice(0, howMany); | |
for (const button of connectionButtons) { | |
button.click(); | |
await delay(400); | |
const menuItem = Array.from(document.querySelectorAll('button')).find(item => item.innerText.includes('Remove connection')); | |
if (menuItem) { | |
menuItem.click(); | |
await delay(400); | |
const confirmButton = document.querySelector('button[aria-label^="Remove"]'); | |
if (confirmButton) { | |
confirmButton.click(); | |
await delay(700); | |
} | |
} | |
await delay(1400); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment