GithubHelp home page GithubHelp logo

jqueguiner / lk_scraper Goto Github PK

View Code? Open in Web Editor NEW
64.0 5.0 14.0 327 KB

An fully configurable linkedin scrape : scrape anything within linkedin

License: Other

Jupyter Notebook 86.89% Python 13.04% Dockerfile 0.07%

lk_scraper's Introduction

LinkedIn Scraper

Scrapes Any LinkedIn Data

Installation

$ pip install git+git://github.com/jqueguiner/lk_scraper

Setup

Using Docker compose

$ docker-compose up -d
$ docker-compose run lk_scraper python3

Using Docker only for Selenium server

First, you need to run a Selenium server

$ docker run -d -p 4444:4444 --shm-size 2g selenium/standalone-firefox:3.141.59-20200326

After running this command, from the browser navigate to your IP address followed by the port number and /grid/console. So the command will be http://localhost:4444/grid/console.

Retrieving Cookie

Browser-Independent:

Navigate to LinkedIn.com and log in
Open up the browser developer tools (Ctrl-Shift-I or right click -> inspect element)

https://www.nextscripts.com/images/sc/alt-LI-002-ch.png https://i.stack.imgur.com/pVMyz.png

Chrome:

Select the Application tab
Under the Storage header on the left-hand menu, click the Cookies dropdown and select www.linkedin.com
Find the li_at cookie, and double click the value to select it before copying

Firefox:

Select Storage tab
Click the Cookies dropdown and select www.linkedin.com
Find and copy the li_at value

Setting up the cookie

Method 1 : Setting the cookie in the config file

You can add your LinkedIn li_at cookie in the config file that is located in your home (~/.lk_scraper/config.yml) see https://github.com/jqueguiner/lk_scraper/raw/master/config_yaml.png

Method 2 : Setting the cookie at the Scraper level

from lk_scraper import Scraper
li_at = "My_super_linkedin_cookie"
scraper = Scraper(li_at=li_at)

Method 3 : Using Variable Environment

(Not implemented Yet)

$ export LI_AT="My_super_linkedin_cookie"

A full working example

Run the Jupyter notebook linkedin-example.ipynb

Usage

from lk_scraper import Scraper
scraper = Scraper()

Company Scraping

from lk_scraper import Scraper
scraper = Scraper()
company = scraper.get_object(object_name='company', object_id='apple')

Profil Scraping

from lk_scraper import Scraper
scraper = Scraper()
profil = scraper.get_object(object_name='profil', object_id='jlqueguiner')

lk_scraper's People

Contributors

danielf-5 avatar hugoch avatar jqueguiner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

lk_scraper's Issues

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.