Quero transformar o formulário (que está funcionando) em um curl para rodar no 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>
Tentativa de curl em 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)