DEV Community

Cover image for How to Automatically Remove All LinkedIn Connections with Python
Muhammad ABir
Muhammad ABir

Posted on

How to Automatically Remove All LinkedIn Connections with Python

Are you tired of manually removing LinkedIn connections one by one? It can be time-consuming and frustrating, especially if you have hundreds or even thousands of connections that you no longer need. Well, I’ve created a solution for you!

With this Python script, you can automatically remove unwanted LinkedIn connections with just a few lines of code. This script uses Selenium to interact with LinkedIn’s web interface, mimicking human behavior, and automating the process of removing connections. No need to worry about account bans, as the script simulates human-like interaction with pauses between actions.

Key Features:

  • Automates the Removal of LinkedIn Connections: Save time by removing unwanted connections in bulk.
  • Human-Like Interaction: The script waits between actions, ensuring that LinkedIn doesn’t flag your account for suspicious activity.
  • Easy to Use: Simply input your login credentials, run the script, and let it do the rest!

How It Works:

  1. Login to LinkedIn: The script logs into your LinkedIn account using your email and password stored in an .env file for added security.
  2. Navigate to Connections Page: It goes directly to your LinkedIn connections page, where all your connections are listed.
  3. Click and Remove: For each connection, the script clicks the "More" button, selects "Remove Connection," and confirms the removal.
  4. Continuous Removal: The script continues to remove connections one by one with pauses between actions to simulate human behavior.

How to Use:

  1. Clone the repository or download the script from the GitHub link.
  2. Set up your environment by installing the required dependencies and creating a .env file with your LinkedIn credentials.
  3. Run the script, sit back, and let it do the work!

Requirements:

  • Python 3.10.x
  • Selenium
  • Firefox

Final Words:

This script is a simple yet powerful tool for anyone who needs to clean up their LinkedIn connections. Whether you’ve added people by mistake or just want to declutter your network, this script will save you time and effort.

If you found this post helpful, make sure to like and comment below. Don’t forget to check out the full script on Blog and watch the video tutorial here.

Happy coding! 🚀

Top comments (0)