The code doesn't work, and I cannot figure out why.
I found the input values using FireFox developer inspector. password is of type password, pwdtext is a text, but only password is connected to the input field. Submit is called login and its content is Log In. Still I cannot logging, and I cannot figure out what I'm doing wrong.
Cookies is always empty. I believe that I have type missmatch, or I'm missing additional inputs.
login_data = {
'username' : 'UserName',
'password' : "Password", #This a password type in the html
'pwdtext' :'Password', #This has no value and no html widget connected to
'login' : "Log In"
}
headers = {'User-agent':
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_7)'}
with requests.session() as c:
request = c.post('http://share.food.com/registration/login.esi', data=login_data,headers=headers)
print(request.url)
print(request.cookies)
request = c.get('http://www.food.com/recipe-finder/all/shrimp?pn=25')
print (request.cookies)