You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 KiB
13 KiB
<html>
<head>
</head>
</html>
In [5]:
import sys
!{sys.executable} -m pip install linkedin-api~=2.0.0a
https://www.linkedin.com/uas/authenticate
# clone the repo
$ git clone https://github.com/KungPaoChick/Find_LinkedIn_jobs.git
# change the working directory to Find_LinkedIn_jobs
$ cd Find_LinkedIn_jobs/
# install the requirements
$ python -m pip install -r requirements.txt
Requirement already satisfied: linkedin-api~=2.0.0a in /opt/conda/lib/python3.9/site-packages (2.0.0a5) Requirement already satisfied: lxml in /opt/conda/lib/python3.9/site-packages (from linkedin-api~=2.0.0a) (4.6.3) Requirement already satisfied: requests in /opt/conda/lib/python3.9/site-packages (from linkedin-api~=2.0.0a) (2.26.0) Requirement already satisfied: beautifulsoup4 in /opt/conda/lib/python3.9/site-packages (from linkedin-api~=2.0.0a) (4.10.0) Requirement already satisfied: soupsieve>1.2 in /opt/conda/lib/python3.9/site-packages (from beautifulsoup4->linkedin-api~=2.0.0a) (2.0.1) Requirement already satisfied: charset-normalizer~=2.0.0 in /opt/conda/lib/python3.9/site-packages (from requests->linkedin-api~=2.0.0a) (2.0.0) Requirement already satisfied: certifi>=2017.4.17 in /opt/conda/lib/python3.9/site-packages (from requests->linkedin-api~=2.0.0a) (2021.5.30) Requirement already satisfied: urllib3<1.27,>=1.21.1 in /opt/conda/lib/python3.9/site-packages (from requests->linkedin-api~=2.0.0a) (1.26.7) Requirement already satisfied: idna<4,>=2.5 in /opt/conda/lib/python3.9/site-packages (from requests->linkedin-api~=2.0.0a) (3.1)
In [6]:
from linkedin_api import Linkedin
# Authenticate using any Linkedin account credentials
api = Linkedin('theomallone@protonmail.com', 'sF89ZxbgmzzRDb5o')
#
--------------------------------------------------------------------------- ChallengeException Traceback (most recent call last) /tmp/ipykernel_903/1337765878.py in <module> 2 3 # Authenticate using any Linkedin account credentials ----> 4 api = Linkedin('theomallone@protonmail.com', 'sF89ZxbgmzzRDb5o') 5 6 # /opt/conda/lib/python3.9/site-packages/linkedin_api/linkedin.py in __init__(self, username, password, authenticate, refresh_cookies, debug, proxies, cookies, cookies_dir) 67 self.client._set_session_cookies(cookies) 68 else: ---> 69 self.client.authenticate(username, password) 70 71 def _fetch(self, uri, evade=default_evade, base_request=False, **kwargs): /opt/conda/lib/python3.9/site-packages/linkedin_api/client.py in authenticate(self, username, password) 100 return 101 --> 102 self._do_authentication_request(username, password) 103 self._fetch_metadata() 104 /opt/conda/lib/python3.9/site-packages/linkedin_api/client.py in _do_authentication_request(self, username, password) 155 156 if data and data["login_result"] != "PASS": --> 157 raise ChallengeException(data["login_result"]) 158 159 if res.status_code == 401: ChallengeException: CHALLENGE
In [ ]:
GET
In [3]:
a profile
profile = api.get_profile('theo-mallone-076b92222')
--------------------------------------------------------------------------- ChallengeException Traceback (most recent call last) /tmp/ipykernel_903/2324783025.py in <module> 2 3 # Authenticate using any Linkedin account credentials ----> 4 api = Linkedin('theomallone@protonmail.com', 'sF89ZxbgmzzRDb5o') 5 6 # GET a profile /opt/conda/lib/python3.9/site-packages/linkedin_api/linkedin.py in __init__(self, username, password, authenticate, refresh_cookies, debug, proxies, cookies, cookies_dir) 67 self.client._set_session_cookies(cookies) 68 else: ---> 69 self.client.authenticate(username, password) 70 71 def _fetch(self, uri, evade=default_evade, base_request=False, **kwargs): /opt/conda/lib/python3.9/site-packages/linkedin_api/client.py in authenticate(self, username, password) 100 return 101 --> 102 self._do_authentication_request(username, password) 103 self._fetch_metadata() 104 /opt/conda/lib/python3.9/site-packages/linkedin_api/client.py in _do_authentication_request(self, username, password) 155 156 if data and data["login_result"] != "PASS": --> 157 raise ChallengeException(data["login_result"]) 158 159 if res.status_code == 401: ChallengeException: CHALLENGE
In [ ]:
# GET a profiles contact info
contact_info = api.get_profile_contact_info('billy-g')
# GET 1st degree connections of a given profile
connections = api.get_profile_connections('1234asc12304')
In [ ]:
In [ ]: