Skip to main content

A python library to scrape user's messages data from linkedin automatically.

Project description

Linkedin-Message-Scraper-Bot is a python library to scrape messages of a user on linkedin using browser automation. It currently runs only on windows.

Example

In this example we first import library, then we login with cookies and then scrape data.

from linkedin_message_scraper_bot import *
true=True;false=False
list_of_cookies=[
{
    "domain": ".linkedin.com",
    "expirationDate": 1676463230,
    "hostOnly": false,
    "httpOnly": false,
    "name": "_ga",
    "path": "/",
    "sameSite": "unspecified",
    "secure": false,
    "session": false,
    "storeId": "0",
    "value": "GA1.2.1029585723.1610264105",
    "id": 1
}]
#please replace the above sample cookies with your cookies, can see below link of how to fetch cookies
linkedin.login_cookie(cookies=list_of_cookies)
response=linkedin.get_messages(profile_link='https://www.linkedin.com/in/abhishek-chaudhary-/')
data=response['body']

This module depends on the following python modules

BotStudio

bot_studio is needed for browser automation. As soon as this library is imported in code, automated browser will open up. Complete documentation for Linkedin Automation available here. Please check this link how to get cookies to login to your linkedin.

Installation

pip install linkedin-message-scraper-bot

Import

from linkedin_message_scraper_bot import *

Login with credentials

linkedin.login(username="linkedin username",password="linkedin password")

Login with cookies

linkedin.login_cookie(cookies=list_of_cookies)

Get Messages of a user

response=linkedin.get_messages(profile_link='profile_link')
data=response['body']

Send Feedback to Developers

bot_studio.send_feedback(feedback="Need help with this ......")

Cookies

To login with cookies Edit this Cookie Extension can be added to browser. Please check this link how to get cookies to login to your linkedin.

Contact Us

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

linkedin-message-scraper-bot-1.0.0.tar.gz (2.8 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page