How to extract LinkedIn data with python?

4

Everyone, good? So I need to extract some information for a research I do at university and I need to extract some data from LinkedIn pages, I was extracting with python using regular expressions, but to extract some things it was very difficult to find some standard for me I can use regular expressions, but I know I can directly extract the xml from the linkedIn page, if I'm not mistaken, the linkedIn itself has an api, called rest api, someone knows how to use it or how to do this?

    
asked by anonymous 24.09.2015 / 00:26

1 answer

2

To use such an API, simply register your APP on LinkedIn developers and create a script that will perform http requests for get the site data ( More details in the documentation itself ).

Fortunately, there is a python module that acts as an abstraction layer, which allows us to save time by avoiding coding the request scripts again. The module name is python-LinkedIn , and is available for download through the pip.

Example of official documentation

  

from linkedin import linkedin

     

API_KEY="wFNJekVpDCJtRPFX812pQsJee-gt0zO4X5XmG6wcfSOSlLocxodAXNMbl0_hw3Vl"

     

API_SECRET="daJDa6_8UcnGMw1yuq9TjoO_PMKukXMo8vEMo7Qv5J-G3SPgrAV0FqFCd0TNjQyG"

     

RETURN_URL=" link "

     

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

     

print (authentication.authorization_url)

     

application = linkedin.LinkedInApplication (authentication)

The values that should go into the API_SECRET and API_KEY variables are informed to you as soon as you perform the registration of your APP (These are unique values and should only be used by you in a specific project.)

    
24.09.2015 / 05:36