http://www.onid.org.br/portal/login
user: thiagocavila@gmail.com
password: senha
I tryied this:
- Code: Select all
-THIS CODE IS UPDATED BELOW, PLEASE DON'T TRY THIS ONE-
#!/usr/bin/env python
import urllib, urllib2, cookielib, re
from sys import argv
host = 'www.onid.org.br'
user_agent = 'Mozilla/4.0 (compatible; MSIE 6.0)'
referer = 'http://www.onid.org.br/portal/login'
content_type = 'application/x-www-form-urlencoded'
accept_encoding = 'gzip,deflate'
body = {'username': 'thiagocavila@gmail.com', 'password': 'senha'}
#build cookie handler
cj = cookielib.CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
urllib2.install_opener(opener)
#encode request information
login_data = urllib.urlencode(body)
#send login information
req = urllib2.Request(referer, login_data, values)
page = urllib2.urlopen(req)
#see result
f = open('result.html','w')
print >> f, page.read()
f.close()
But I didn't logged in. Can someone help me?
Thx!!