A python library that uses browser automation to login & search users & scrape user profiles on linkedin It uses datakund internally
Complete Documentation available here
For any help / feedback you can message us here
pip install linkedin-search-people
from linkedin-search-people import *
To search for users & fetch results on linkedin first we will login to linkedin. There are two ways of login:-
- Credentials
- Cookies
linkedin.login(email="",password="")
linkedin.login_cookie(cookies="list_of_cookies")
To login with cookies Edit this Cookie Extension can be added to browser and login to linkedin.com , then export cookies and paste in above function of login_cookie
. Below is the example of cookies.
{
"domain": "linkedin.com",
"expirationDate": 1671116358.392265,
"hostOnly": false,
"httpOnly": false,
"name": "__Secure-3PAPISID",
"path": "/",
"sameSite": "no_restriction",
"secure": true,
"session": false,
"storeId": "0",
"value": "Y1zkx3HJhktM4Y__/A-aOUDHse1TaSaKpQ",
"id": 1
},
{
"domain": "linkedin.com",
"expirationDate": 1672322803.302724,
"hostOnly": false,
"httpOnly": true,
"name": "__Secure-3PSID",
"path": "/",
"sameSite": "no_restriction",
"secure": true,
"session": false,
"storeId": "0",
"value": "5AcqKCt5MuBkjOpLW7PdfNs83knLqt-qVZJzCriY_4_cftxmyExDbYRS65ezLjpKa_Xc7Q.",
"id": 2
},
...
...
]
To search for users on linkedin we use search_people
function.
It requires keyword as input parameter.
linkedin.search_people(keyword="people_search_keyword_here")
To fetch profile links from search results we use people_results
function.
It does not require any input parameter.
response=linkedin.people_results()
profile_links=response['body']
[
{
"Link":"Link 1"
},
{
"Link":"Link 2"
},
...
]
It uses datakund internally to do browser automation DataKund is an automation library that uses selenium & supports automation of many sites including Youtube, Amazon, Twitter, LinkedIn , Google etc.