dimanche 27 avril 2014

why isn't Requests not signing into a website correctly?


Vote count:

0




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('http://ift.tt/iMnaLP', 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('http://ift.tt/1fhMG59')
#saving the results in an HTML file for easy debugging/viewing
html= open('testtest.html', 'w')
html.write(r.content)
html.close()


asked 51 secs ago






Aucun commentaire:

Enregistrer un commentaire