This is a micro project meant to test and gradually learn about Puppeteer and web-scraping using JavaScript.
Puppeteer is a Node library which provides a high-level API to control Chrome or Chromium over the DevTools Protocol. Puppeteer runs headless by default, but can be configured to run full (non-headless) Chrome or Chromium.
-
Logs into a LinkedIn account according to the credentials provided as specified environment variables.
-
Loads the feed and searches for the people with a provided keyword.
-
Sends connection request to the listed profiles matching the keyword(s).
Install npm packages:
npm install
Create a .env file.touch .env
Run using the node.node app.js
A chrome browser will pop up showing the browser and the automated processes. You can switch it to run in the headless mode changing the headless option to true as shown:
const browser = await puppeteer.launch({ headless: true });