-
-
Save AglaianWoman/dee4fe7c3d5474544b53f7eb090df3a7 to your computer and use it in GitHub Desktop.
linkedin login bs4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from bs4 import BeautifulSoup | |
client = requests.Session() | |
HOMEPAGE_URL = 'https://www.linkedin.com?allowUnsupportedBrowser=true' | |
LOGIN_URL = 'https://www.linkedin.com/uas/login-submit?allowUnsupportedBrowser=true' | |
html = client.get(HOMEPAGE_URL).content | |
soup = BeautifulSoup(html) | |
csrf = soup.find(id="loginCsrfParam-login")['value'] | |
login_information = { | |
'session_key':'username', | |
'session_password':'password!', | |
'loginCsrfParam': csrf, | |
} | |
client.post(LOGIN_URL, data=login_information) | |
x = client.get('http://www.linkedin.com/messaging/') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment