A python library that uses browser automation to login & search for groups on linkedin & fetch results It uses datakund internally
Complete Documentation available here
For any help / feedback you can message us here
pip install linkedin-search-groups
from linkedin-search-groups import *
To search for groups & 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 groups on linkedin we use search_groups
function.
It requires keyword as input parameter.
linkedin.search_groups(keyword="groups_search_keyword_here")
To fetch groups from search results we use groups_results
function.
It does not require any input parameter.
response=linkedin.groups_results()
groups=response['body']
[
{
"Title":"Title 1",
"Group Link":"Group Link 1",
"Members":"Members 1"
},
{
"Title":"Title 2",
"Group Link":"Group Link 2",
"Members":"Members 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.