A Python automation script that extracts email addresses from comments on any LinkedIn post and saves them to a CSV file.
- π Extracts email addresses from public LinkedIn post comments
- π¬ Captures full comment text (with optional commenter name)
- β Skips duplicates and plain email-only comments (optional)
- ποΈ Auto-versioned output files (no overwriting)
- π₯οΈ Uses your own Chrome session (no headless or login automation)
- macOS or Linux (tested)
- Python 3.8 or higher
- Google Chrome (installed)
- ChromeDriver (must match your Chrome version)
pip install selenium pandas-
Clone or download this repository.
-
Update the post URL in
linkedin_scraper.py:
POST_URL = 'https://www.linkedin.com/feed/update/urn:li:activity:YOUR_POST_ID/'- Run the script:
python3 linkedin_scraper.py- A Chrome window will open:
- Log in to LinkedIn if needed
- The script will scroll and extract all visible comments
Youβll get a CSV file like:
linkedin_emails_with_comments.csv
If that file already exists, it auto-generates:
linkedin_emails_with_comments_1.csv
linkedin_emails_with_comments_2.csv
| Author (optional) | Comment | |
|---|---|---|
| Saurav Mehta | [email protected] | Please connect at saurav@... |
| β | [email protected] | [email protected] |
This script is intended for personal use only.
Scraping LinkedIn at scale may violate their Terms of Service.
Use responsibly and ethically.
- Built with β€οΈ by Suraj Verma
- Inspired by creators, mentors, and productivity tools
- Connect on LinkedIn