I have this code:
import requests
url = 'https://mobile.twitter.com/session/new'
payload = {
'username': 'username',
'password': 'password',
}
with requests.Session() as c:
c.post(url, data=payload)
r = c.get('https://mobile.twitter.com/account')
print 'username' in r.content
The goal is to login to twitter mobile (I know there is an API, this is just for fun)... I already create a similar script using mechanize, and it works!
What's wrong with my code? Thanks