How to extract data from Linkedin with python?

Asked

Viewed 1,553 times

3

Hey, guys, what’s up? So, I need to extract some information for a research I do at the university and I need to extract some data from Linkedin pages, I was extracting with python using regular expressions, but to extract some things was very difficult to find some pattern for me to use regular expressions, only that I know it has to extract directly the xml from Linkedin’s page, if I’m not mistaken Linkedin itself has an api, called Rest api, someone knows as use it or as do this?

1 answer

3


To use such an API, simply register your APP on Linkedin Developers and create a script that performs http requests to get website data (More details in the documentation itself).

Fortunately, there is a python module that works as an abstraction layer, which allows us to save time by avoiding codifying the request scripts again. The name of the module is python-Linkedin, and is available for download via Pip.

#Example of official documentation

from linkedin import linkedin 

API_KEY = "wFNJekVpDCJtRPFX812pQsJee-gt0zO4X5XmG6wcfSOSlLocxodAXNMbl0_hw3Vl" 

API_SECRET = "daJDa6_8UcnGMw1yuq9TjoO_PMKukXMo8vEMo7Qv5J-G3SPgrAV0FqFCd0TNjQyG"

RETURN_URL = "http://localhost:8000"

authentication = linkedin.LinkedInAuthentication(API_KEY, API_SECRET, RETURN_URL, linkedin.PERMISSIONS.enums.values())

print(authentication.authorization_url) 

application = linkedin.LinkedInApplication(authentication)

The values that must go in the variables API_SECRET and API_KEY are informed to you once you register your APP (They are unique values and should be used only by you in a specific project).

Browser other questions tagged

You are not signed in. Login or sign up in order to post.