Skip to content

savedpixel/linkedin-network-connection-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ€– LinkedIn Network Connection Bot

The best LinkedIn network connection script available to grow your audience. Fully automated, configurable, and built to run locally or on a VPS.

⭐ If you clone this repo, please give it a star. It helps others find it and keeps the project going.

Automated LinkedIn connection request bot built with Python and Selenium. Searches for professionals by keyword, filters profiles, and sends connection invites on autopilot.

Supports two modes: a simple keywords mode for flat keyword lists, and a group sets mode with weekly rotation scheduling (one group per day).

✨ Features

  • πŸ” Keyword search - find people by job title, skill, or role
  • πŸ›‘οΈ Profile filtering - skip profiles that don't match your target keywords, block specific companies
  • πŸ”„ Two run modes - flat keyword list or weekly group rotation with day-of-week scheduling
  • πŸ“Š Daily and weekly limits - configurable caps to stay within LinkedIn's guidelines
  • πŸ• Anti-detection delays - randomized timing between actions
  • 🧩 Shadow DOM modal handling - works with LinkedIn's current (2026) connection dialog
  • πŸ“§ Auto-OTP via IMAP - optionally reads verification codes from your email inbox
  • πŸ–₯️ VPS-ready - runs headless with Xvfb on any Linux server
  • πŸ“ˆ Metrics tracking - logs every session, tracks daily/weekly totals per group set

πŸš€ Quick Start

1. Clone and configure

git clone https://github.com/savedpixel/linkedin-network-connection-bot.git
cd linkedin-network-connection-bot

# Set up credentials
cp .env.example .env
# Edit .env with your LinkedIn email and password

2. Run locally

python run.py

On first run, env_bootstrap.py automatically creates a virtual environment and installs dependencies (selenium, python-dotenv, webdriver-manager). No manual setup needed.

3. Run on VPS (headless)

bash run_with_xvfb.sh

Requires Xvfb and Chrome/Chromium installed on the server. The script handles the virtual display.

βš™οΈ How It Works

  1. Login - navigates to LinkedIn and logs in with your credentials
  2. OTP handling - if LinkedIn asks for verification, the bot tries auto-IMAP retrieval first, then falls back to manual input (local) or file exchange (VPS)
  3. Search - loads LinkedIn people search for each keyword
  4. Filter - reads each profile card, checks for matching keywords and skip-list entries
  5. Connect - clicks Connect, handles the modal, sends invite (with or without a note)
  6. Track - logs the connection to metrics, checks limits, moves to the next profile or keyword

πŸ”€ Run Modes

Keywords Mode ("mode": "keywords")

Processes a flat list of keywords sequentially. The bot searches each keyword, connects with matching profiles, and stops when the daily or weekly limit is reached.

{
  "mode": "keywords",
  "keywords_config": {
    "keywords": ["ai engineer", "ml engineer", "genai engineer"]
  }
}

Best for simple, ad-hoc networking when you have a short list of target roles.

Group Sets Mode ("mode": "group_sets")

Organizes keywords into groups, each assigned to a day of the week. One group runs per day on a weekly rotation. Multiple group sets can be defined and switched between.

{
  "mode": "group_sets",
  "group_sets_config": {
    "active_set": "ai",
    "invites_per_keyword": 5,
    "keywords_per_group": 4,
    "sets": {
      "ai": {
        "name": "AI & Machine Learning",
        "groups": [
          {
            "id": "ai_engineers",
            "name": "AI Engineers",
            "run_day": "Monday",
            "keywords": ["ai engineer", "ml engineer", "deep learning engineer"]
          }
        ]
      }
    }
  }
}

Best for sustained, long-term networking campaigns that spread activity evenly across the week.

πŸ”§ Configuration

All non-secret settings live in search_config.json. Credentials are stored in .env (never committed).

Credentials (.env)

LINKEDIN_USERNAME=your_email@example.com
LINKEDIN_PASSWORD=your_password_here

Optional IMAP settings for auto-OTP:

IMAP_HOST=imap.gmail.com
IMAP_PORT=993
IMAP_USER=your_email@example.com
IMAP_PASS=your_app_password
OTP_CLEANUP=false

πŸ“ Project Structure

run.py                 Main bot logic (search, filter, connect, metrics)
run_wrapper.py         VPS entry point (headless Chrome, file-based OTP)
env_bootstrap.py       Auto-creates .venv and installs dependencies
otp_email.py           IMAP-based OTP auto-retrieval module
search_config.json     All bot settings (modes, limits, keywords, groups)
.env.example           Credential template
run_with_xvfb.sh       VPS launcher with Xvfb virtual display
data/metrics.json      Connection tracking and run history

πŸ›‘οΈ Limits and Safety

The bot enforces configurable limits to reduce the risk of LinkedIn restrictions:

Limit Default Config Key
Daily invites 15 limits.max_daily_invites
Weekly invites 80 limits.max_weekly_invites
Max search pages per keyword 10 pagination.max_pages
Min delay between actions 13s delays_seconds.min_delay
Max delay between actions 28s delays_seconds.max_delay

These are conservative defaults. Adjust based on your account standing and risk tolerance.

πŸ“‹ Requirements

  • Python 3.10+
  • Google Chrome or Chromium
  • ChromeDriver (auto-managed by webdriver-manager)
  • For VPS: Xvfb

⏰ Automate with Cron (VPS)

To run the bot once a day automatically on a VPS, add a cron job:

crontab -e

Add a line to run at 9:00 AM daily (adjust the time and path to your setup):

0 9 * * * /path/to/linkedin-network-connection-bot/run_with_xvfb.sh >> /path/to/linkedin-network-connection-bot/logs/cron.log 2>&1

The bot handles its own daily and weekly limits, so it's safe to schedule it every day. In group_sets mode, each day automatically runs only the group assigned to that day.

⚠️ Disclaimer

This tool automates actions on LinkedIn, which may violate LinkedIn's Terms of Service. Use at your own risk. The authors are not responsible for any account restrictions or bans resulting from use of this software.

πŸ“„ License

MIT

About

The best automated LinkedIn connection bot. Searches by keyword, filters profiles, and sends connection invites on autopilot. Dual-mode: flat keyword lists or weekly group rotation. Built with Python and Selenium.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors