A Python-based LinkedIn profile scraper that uses Selenium to extract profile information including name, work experience, and education details.
Before running this project, make sure you have the following installed:
-
Python 3.7+
Download from python.org -
Google Chrome Browser
Download from google.com/chrome -
ChromeDriver
- Download ChromeDriver that matches your Chrome browser version from chromedriver.chromium.org
- Place
chromedriver.exein the project root directory
-
Clone the repository
git clone https://github.com/AKProgramer/Linkedln-Scraper.git cd Linkedln-Scraper -
Install required Python packages
pip install -r requirements.txt
You need to provide your LinkedIn credentials to run the scraper. Use one of the following methods:
Windows (PowerShell):
$env:LINKEDIN_USER="your_email@example.com"
$env:LINKEDIN_PASSWORD="your_password"Linux/Mac:
export LINKEDIN_USER="your_email@example.com"
export LINKEDIN_PASSWORD="your_password"Windows:
- Search for "Environment Variables" in Windows search
- Click "Edit the system environment variables"
- Click "Environment Variables" button
- Under "User variables", click "New" and add:
- Variable name:
LINKEDIN_USER - Variable value:
your_email@example.com
- Variable name:
- Add another variable:
- Variable name:
LINKEDIN_PASSWORD - Variable value:
your_password
- Variable name:
- Restart your terminal after setting these
-
Make sure you've set your LinkedIn credentials (see Configuration section above)
-
Run the scraper:
python -m samples.scrape_person
-
The script will:
- Open Chrome browser
- Log into LinkedIn with your credentials
- Navigate to the specified profile
- Extract and display profile information
The script outputs the person's profile information including:
- Name
- Work experiences (position, company, duration, location, description)
- Education (institution, degree)
Edit samples/scrape_person.py and change the LinkedIn URL on this line:
person = Person("https://www.linkedin.com/in/your-profile-url", driver=driver)linkedin_scraper/
├── linkedin_scraper/ # Main scraper package
│ ├── __init__.py
│ ├── person.py # Person profile scraper
│ ├── company.py # Company scraper
│ ├── actions.py # Login and navigation actions
│ └── selectors.py # CSS selectors for scraping
├── samples/ # Sample scripts
│ ├── scrape_person.py
│ └── scrape_person_contacts.py
├── chromedriver.exe # ChromeDriver (you need to download this)
├── requirements.txt # Python dependencies
└── README.md # This file
-
"Python was not found"
- Install Python from python.org
- During installation, check "Add Python to PATH"
-
"ModuleNotFoundError: No module named 'linkedin_scraper'"
- Run the script using:
python -m samples.scrape_person - Or install the package:
pip install -e .
- Run the script using:
-
"Unable to obtain driver for chrome"
- Download ChromeDriver from chromedriver.chromium.org
- Place
chromedriver.exein the project root directory - Make sure the ChromeDriver version matches your Chrome browser version
-
"ConnectionResetError" or login issues
- LinkedIn may block automated logins
- Try using a VPN or different network
- Ensure your credentials are correct
- LinkedIn may require CAPTCHA verification
-
AttributeError for certain attributes
- Some profile attributes may not be available for all users
- The script handles missing attributes gracefully
- Web scraping LinkedIn may violate their Terms of Service
- Use this tool responsibly and only for permitted purposes
- Consider LinkedIn's rate limits and avoid excessive requests
- Respect user privacy and data protection regulations
See the LICENSE file for details.
For issues or questions, please open an issue on the GitHub repository.