This script is designed to automate the process of sending connection requests to LinkedIn users who match a certain search query.
- Node.js installed
- LinkedIn account
- Puppeteer - Headless Chrome Node.js API
- Clone the repository
- Set LINKEDIN language to English.
- Install dependencies using
npm installcommand. - Create a
.envfile and fill in the required values. - Set messages in
modules/messages.jsfile. UseNAMEin messages. This will be replaced with name of your target. Every time script choose 1 of messages randomly - Run the script using
node index.jsfor use with visible browser ornode index.js --stealthfor invisible mode.
The .env file should contain the following environment variables:
LINKEDIN_LOGIN: The email address associated with the LinkedIn accountLINKEDIN_PASSWORD: The password for the LinkedIn accountSEARCH_URL: The URL of the search results page on LinkedIn. Use 2nd and 1st circles in search. Not 3d!MAX_PAGE: The maximum number of pages to scrapeTIMEOUT: The maximum time (in milliseconds) to wait between requestsMAX_CLICKED_PROFILES: The maximum number of profiles to send connection requests toSHOULD_ADD_MESSAGE: Whether to include a personalized message in connection requests
- The script launches a Puppeteer-controlled headless browser and navigates to the LinkedIn login page.
- The script logs in to the user's LinkedIn account using the provided credentials.
- The script navigates to the search results page using the provided URL.
- The script iterates over each profile on the page, sending a connection request to the user if they have a "Connect" button and, optionally, including a personalized message.
- The script repeats this process for each subsequent page of search results until it reaches the maximum number of pages specified in the configuration.
- Once the maximum number of profiles to send connection requests to has been reached, the script saves the cookies, write log file, and closes the browser.