I am trying to sign into linkedin by using the requests library. After looking around the best way to do this is with using a requests.Session() I attempted to do this, but I was not successful.
I believe it has something to do with the link I post to.
import requests
payload = {
'session_key': EMAIL_GOES_HERE,
'session_password': PASSWORD_GOES_HERE
}
with requests.Session() as s:
s.post('https://www.linkedin.com/', data=payload)
#program should be signed in here so I am going onto a private page that requeires the user to be signed in.
r=s.get('https://www.linkedin.com/vsearch/p?f_CC=2289109')
#saving the results in an HTML file for easy debugging/viewing
html= open('testtest.html', 'w')
html.write(r.content)
html.close()