linkedin-user-scrape
is a Python package for scraping user profile data from LinkedIn.
You can install linkedin-user-scrape
via pip:
pip install linkedin-user-scrape
from linkedin_user_scrape import *
import json
email = "<your_email>"
password = "<your_password>"
cookie = "<your_cookie>"
userId = "<linkedin_user_id>"
user_details = get_user_profile_data(userId, cookie, email, password)
print(json.dumps(user_details, indent=4))
To use the get_user_profile_data
function, you need to provide a LinkedIn cookie (li_at). You can obtain this cookie by following these steps:
- Open LinkedIn in your web browser and log in.
- Right-click on the page and select "Inspect" (or press Ctrl + Shift + I).
- Go to the "Application" tab (in Chrome) or "Storage" tab (in Firefox).
- Expand the "Cookies" dropdown and select the LinkedIn URL.
- Locate the li_at cookie and copy its value.
The get_user_profile_data
function returns a dictionary with the following structure:
{
"Basic Details": basic_details,
"Work Experience Details": work_experience_details,
"Education Details": education_details,
"Project Details": projects_details,
"Recommendations": recommendations
}
basic_details
: Contains basic information about the LinkedIn user. (Name, Title, Summary)work_experience_details
: Contains details of the user's work experience (Title, Company, Duration).education_details
: Contains details of the user's education (Institure, Course, Duration, Summary).projects_details
: Contains details of the user's projects.recommendations
: Contains recommendations received by the user.