I want to turn the form (which is working) into a curl to run on the backend
<form action="https://pt.stackoverflow.com/users/login?ssrc=head&returnurl=https%3a%2f%2fpt.stackoverflow.com%2f" method="post">
<input type="text" name="email"></input>
<input type="password" name="password"></input>
<input type="submit" value="enviar"></input>
</form>
Attempt to curl in python:
import urllib
url = 'https://pt.stackoverflow.com/users/login?ssrc=head&returnurl=https%3a%2f%2fpt.stackoverflow.com%2f'
values = {'email': '[email protected]', 'password' : '$teste123','submit': 'SUBMIT'}
dados = urllib.urlencode(values)
html = urllib.urlopen(url,dados).read()
print (html)