Giter Site home page Giter Site logo

sahilsingh0808 / linkedin-comments-scraper Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gurbaaz27/linkedin-comments-scraper

0.0 0.0 0.0 408 KB

Script to scrape comments (including name, designation, email(if present) and comment) from a LinkedIn post from the URL of the post.

Python 100.00%

linkedin-comments-scraper's Introduction

LinkedIn Comments Scraper

Brief Overview

If you have used LinkedIn, you must have encountered many posts regarding helpful resources, and they would ask email address,to which replies in comments are usually like

Interested!
<email-address>

I don't like this thing, like you can already share link in the post itself ๐Ÿ˜ . Nevertheless, I thought to automate this work of collecting all emails.
All the comments, with columns of

  • Name of the person commented
  • Designation of the person
  • Email address (if present in comment)
  • Comment (UTF-8 encoded)

are stored in a 'comments_data.csv' file.

Requirements

Install the dependencies in Windows using command:

pip install -r requirements.txt

For Mac/Linux, use:

pip3 install -r requirements.txt

Usage

  • In Config.py, enter the required url of LinkedIn Post in post_url variable:
post_url = ''

If you forget to enter here, it will be asked during run-time of script itself.

  • You can also change csv file name (in which scraped data will be stored) in Config.py .
  • Run the script for Windows:
python PostComments.py

For Linux/Linux, use:

python3 PostComments.py

Login email and password for your LinkedIn account will be asked and process would start.

Scope of Improvement

  • Main problem is that for scraping all comments, they need to be loaded first. This involves: find the "Load more comments" button, clicks, sleeps for 5 seconds and continues this until all comments are loaded. Usually the sleep strategy of 5 seconds works well, but may fail on slow internet connection and needs to be increased. There are certain commands in Selenium to avoid this but I was unsuccessful.

If you can do it or have any suggestions, contribute!:smile:

linkedin-comments-scraper's People

Contributors

sahilsingh0808 avatar gurbaaz27 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.