import requests
from bs4 import BeautifulSoup
s = requests.session()
r = s.get('
https://www.linkedin.com/')
soup = BeautifulSoup(r.text)
loginCsrfParam = soup.find('input', id = 'loginCsrfParam-login')['value']
csrfToken = soup.find('input', id = 'csrfToken-login')['value']
sourceAlias = soup.find('input', id = 'sourceAlias-login')['value']
payload = {
'session_key': 'user@qq.com',
'session_password': 'pass',
'loginCsrfParam' : loginCsrfParam,
'csrfToken' : csrfToken,
'sourceAlias' : sourceAlias
}
s.post('
https://www.linkedin.com/uas/login-submit', data=payload)
print(s.get('
http://www.linkedin.com/nhome').text)