- Prerequisites
- Installation
- Configuration
- Running the Bot
- Command Line Interface
- Troubleshooting
- Safety Guidelines
- Operating System: Windows 10/11, macOS 10.14+, or Linux (Ubuntu 20.04+)
- Python: Version 3.8 or higher
- RAM: Minimum 4GB (8GB recommended)
- Internet: Stable connection required
Choose one of the following:
- Google Chrome (latest version)
- ChromeDriver matching your Chrome version
- Download from: https://chromedriver.chromium.org/
- Mozilla Firefox (latest version)
- GeckoDriver matching your Firefox version
- Download from: https://github.com/mozilla/geckodriver/releases
# Clone from GitHub (if available)
git clone https://github.com/yourusername/LinkedIn_Auto_Connector_Bot.git
cd LinkedIn_Auto_Connector_Bot
# Or extract from ZIP file
unzip LinkedIn_Auto_Connector_Bot.zip
cd LinkedIn_Auto_Connector_Bot# Create virtual environment
python -m venv venv
# Activate virtual environment
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate# Install required packages
pip install -r requirements.txt
# For full features (including rich CLI):
pip install -r requirements.txt --upgrade# macOS (using Homebrew)
brew install chromedriver
# Windows (using Chocolatey)
choco install chromedriver
# Linux
sudo apt-get install chromium-chromedriver
# Or download manually and add to PATH# macOS (using Homebrew)
brew install geckodriver
# Windows (using Chocolatey)
choco install geckodriver
# Linux
sudo apt-get install firefox-geckodriver
# Or download manually and add to PATH# Copy the environment template
cp .env.example .env
# Edit .env file with your favorite editor
nano .env # or vim, code, notepad++, etc.Edit the .env file with your LinkedIn credentials:
# Required Settings
LINKEDIN_USERNAME=your_email@example.com
LINKEDIN_PASSWORD=your_password
# Optional: Customize limits (recommended to start small)
MAX_DAILY_REQUESTS=10
MAX_WEEKLY_REQUESTS=50
MAX_CONNECT_REQUESTS_PER_SESSION=5
# Browser Settings
HEADLESS_MODE=false # Set to true to run without browser window
USE_CHROME=true # Set to false to use FirefoxEdit config.yaml to customize bot behavior:
# Edit config.yaml
nano config.yamlKey settings to modify:
limits:Connection limits per day/weekmessages: templates:Your connection message templatessearch: keywords:Keywords for searching profilesanti_detection:Security features (keep enabled)
- Login to LinkedIn in your regular browser
- Perform a search for the profiles you want to connect with:
- Use the search bar at the top
- Enter keywords like "technical recruiter" or "software engineer"
- Click "People" filter
- Apply any additional filters (location, industry, etc.)
- Copy the URL from your browser's address bar
- Save this URL - you'll need it when running the bot
Example search URL:
https://www.linkedin.com/search/results/people/?keywords=technical%20recruiter&location=United%20States
# Interactive mode (will prompt for credentials)
python cli.py run
# With parameters
python cli.py run --username your_email@example.com --limit 10
# With search URL
python cli.py run -u your_email@example.com -s "YOUR_LINKEDIN_SEARCH_URL" -l 10
# In headless mode (no browser window)
python cli.py run --username your_email@example.com --headless --limit 5# View your connection statistics
python cli.py stats
# View today's statistics only
python cli.py stats --today
# Export stats as JSON
python cli.py stats --format json > stats.json# List saved sessions
python cli.py sessions
# Clean old sessions
python cli.py clean --max-age 48# Test browser setup
python cli.py test --check-browser
# Test authentication
python cli.py test --check-auth
# Check rate limits
python cli.py test --check-rate-limits# Basic execution
python main.py
# With command-line arguments
python main.py --username your_email@example.com \
--search-url "YOUR_SEARCH_URL" \
--limit 10 \
--headlessCreate a file run_bot.py:
from main import LinkedInBot
# Create bot instance
bot = LinkedInBot(headless=False)
# Login
success = bot.login("your_email@example.com", "your_password")
if not success:
print("Login failed!")
exit(1)
# Set search URL
bot.set_search_url("YOUR_LINKEDIN_SEARCH_URL")
# Run bot
results = bot.run(max_connections=10, follow_profiles=True)
# Print results
print(f"Sent {results['connections_sent']} connections")
print(f"Failed {results['connections_failed']} connections")
# Cleanup
bot.cleanup()Run it:
python run_bot.py# Main command
python cli.py [OPTIONS] COMMAND [ARGS]
# Commands:
run # Run the bot to send connections
stats # Display statistics
sessions # Manage saved sessions
clean # Clean old data
config # View/edit configuration
test # Test bot components
# Global options:
--debug # Enable debug logging
--config # Path to custom config filepython cli.py run --message "Hi {name}, I'd love to connect and expand my network. Best regards!"python cli.py run --keywords "software engineer python" --limit 15# List all configuration
python cli.py config --list
# Get specific value
python cli.py config --key daily_limit
# Set configuration value
python cli.py config --key daily_limit --set 20logs/
├── LinkedInBot.log # Main log file
├── LinkedInBot_errors.log # Error logs only
└── LinkedInBot_daily.log # Daily rotating log
# Watch main log
tail -f logs/LinkedInBot.log
# Watch errors only
tail -f logs/LinkedInBot_errors.log
# Search logs
grep "ERROR" logs/LinkedInBot.log
grep "connection sent" logs/LinkedInBot.log# View current statistics
python cli.py stats
# Check if within limits
python cli.py test --check-rate-limitsError: WebDriver not found or chromedriver not in PATH
Solution:
# Check if driver is installed
which chromedriver # or geckodriver
# If not found, download and add to PATH
# Or specify path in .env:
GECKODRIVER_PATH=/path/to/geckodriverError: Failed to login to LinkedIn
Solutions:
- Check credentials in
.envfile - Try logging in manually first to check for:
- CAPTCHA requirements
- Security verification
- Account restrictions
- Use
--no-headlessto see what's happening
Error: Rate limit reached
Solutions:
# Check current limits
python cli.py stats
# Wait until tomorrow or next week
# Or adjust limits in config.yaml (not recommended)Error: Connect button not found
Solutions:
- LinkedIn may have changed their UI
- Try updating the search URL
- Check if you're already connected
- Profile might be premium-only
Error: Session expired or Session corrupted
Solutions:
# Clean old sessions
python cli.py clean --execute
# Delete specific session
rm sessions/your_email_session.enc
# Disable sessions temporarily
# In .env: SESSION_ENABLED=falseFor detailed debugging:
# Run with debug logging
python cli.py --debug run --limit 1
# Check debug log
tail -n 100 logs/LinkedInBot.log- This bot violates LinkedIn's Terms of Service
- Your account may be restricted or banned
- Use at your own risk
- Daily: Maximum 10-15 connections
- Weekly: Maximum 50-80 connections
- Per Session: Maximum 5-10 connections
- Time Between Actions: 3-8 seconds
-
Start Small
- Begin with 5 connections per day
- Gradually increase if no issues
-
Use Random Delays
- Keep
anti_detectionenabled in config - Don't disable human behavior simulation
- Keep
-
Vary Your Activity
- Don't run at the same time every day
- Mix automated and manual activity
- Take breaks (don't use every day)
-
Monitor Your Account
- Check for warning messages from LinkedIn
- Stop immediately if you receive warnings
- Watch for "unusual activity" notifications
-
Use Personalized Messages
- Customize message templates
- Make them relevant to the recipient
- Avoid generic spam-like messages
-
Session Management
- Don't login too frequently
- Use saved sessions when possible
- Clean old sessions regularly
- LinkedIn asks for phone verification frequently
- You receive "unusual activity" warnings
- Connection requests start failing consistently
- Your account gets temporarily restricted
- Search results become limited
-
Run During Business Hours
- More natural activity pattern
- Better response rates
-
Target Relevant Profiles
- Use specific search keywords
- Filter by location and industry
- Quality over quantity
-
Optimize Message Templates
- Keep under 300 characters
- Personalize with {name} and {title}
- A/B test different messages
-
System Resources
- Close unnecessary programs
- Use headless mode for better performance
- Ensure stable internet connection
README.md- Project overviewCLAUDE.md- Technical documentationconfig.yaml- Configuration options
# General help
python cli.py --help
# Command-specific help
python cli.py run --help
python cli.py stats --help- Check logs first:
logs/LinkedInBot_errors.log - Include error messages and stack traces
- Specify your environment (OS, Python version, browser)
# Pull latest changes (if using git)
git pull origin main
# Update dependencies
pip install -r requirements.txt --upgrade
# Check for configuration changes
diff .env.example .env
diff config.yaml.example config.yaml- Python 3.8+ installed
- Virtual environment created and activated
- Dependencies installed (
pip install -r requirements.txt) - WebDriver installed (ChromeDriver or GeckoDriver)
-
.envfile created with LinkedIn credentials - LinkedIn search URL obtained
- Test run with small limit (5 connections)
- Logs checked for errors
- Statistics reviewed
Remember: Use responsibly and within LinkedIn's acceptable use limits to avoid account restrictions!