Possible Duplicate:
How to “log in” to a website using Python’s Requests module?
I'm programming an application in python 3.2.3, and I don't know how to login to a website. I need to login... and save cookies(I think), but everything I tried doesn't work.
I had try Requests, but no luck. My webpage is running on localhost (it's just simple login form).
FORM:
<form method="post" action="">
<input type="text" name="uname" placeholder="Uporabnisko ime:"/>
<input type="password" name="password" placeholder="Geslo:"/>
<input type="submit" value="Send"/>
</form>
Python:
import requests
payload = {'uname': 'name', 'password': 'pswd123'}
r = requests.post('http://localhost/python', data=payload)
This do nothing. How to post name and username.. Thanks for reply.