/LinkedInAutoConnect

An automated script to accept connection requests on LinkedIn

Primary LanguagePython

What's this?

This project helps in automatically accepting the LinkedIn connections requests. It has two versions:

  • Javascript based version
  • Selenium based version
  • Javascript based version doc

    Prerequisites

  • User should be signedIn on LinkedIn
  • Run

  • Open your LinkedIn account and go to this url manage connections
  • Open the console and run the script given in autoConnectJavaScript.js
  • Selenium based version doc

    Prerequisites

  • Clone the repo in your local machine: git clone git@github.com:aniketsingh0104/LinkedInAutoConnect.git
  • Go to the directory: cd LinkedInAutoConnect. Setup virtual environment: python3 -m venv ./venv
  • Activate virtual environment: source venv/bin/activate
  • Run this command inside the project directory to install dependencies: pip install -r requirements.txt
  • For chrome driver see section : Setting up the Selenium Driver
  • Inside main.py enter your chromium driver path in this variable driver_path
  • Make sure that your computer's doesn't sleep while you are running this script.
  • Setting up the Selenium Driver

    The application uses Chrome as the web driver. If you want to use any other browser, make sure you modify the scrip and download appropriate drivers. Below instructions are for chrome although a lot of them would be transferable:

  • Download the chrome driver for your Google Chrome Version from chromium drivers: link
  • Store it in a location and copy the path.
  • On a Mac, for your chrome driver to be allow-listed, fire up the below command on your terminal along with the path to your chrome driver. This is needed to allow the macOS to allow-list the driver and not check for a verified publisher. (source):
  • xattr -d com.apple.quarantine <PATH_OF_DRIVER>
    

    Run

  • Go inside the project directory and run: python main.py
  • It would open up LinkedIn page, perform the signIn manually and then leave the script, it would start accepting your requests.
  • Troubleshooting

  • As this script targets the accept button by its class, there might be cases in which class of the linkedin accept button is changed, in that case go to contants.py file and change the second parameter (after @class) of XPATH_PATTERN_OF_LINKEDIN_CONNECTION_ACCEPT_BUTTON with correct class pattern