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).
- π 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
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 passwordpython run.pyOn first run, env_bootstrap.py automatically creates a virtual environment and installs dependencies (selenium, python-dotenv, webdriver-manager). No manual setup needed.
bash run_with_xvfb.shRequires Xvfb and Chrome/Chromium installed on the server. The script handles the virtual display.
- Login - navigates to LinkedIn and logs in with your credentials
- 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)
- Search - loads LinkedIn people search for each keyword
- Filter - reads each profile card, checks for matching keywords and skip-list entries
- Connect - clicks Connect, handles the modal, sends invite (with or without a note)
- Track - logs the connection to metrics, checks limits, moves to the next profile or keyword
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.
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.
All non-secret settings live in search_config.json. Credentials are stored in .env (never committed).
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
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
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.
- Python 3.10+
- Google Chrome or Chromium
- ChromeDriver (auto-managed by
webdriver-manager) - For VPS: Xvfb
To run the bot once a day automatically on a VPS, add a cron job:
crontab -eAdd 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.
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.
MIT