使用指定的参数生成cookie,并用这个cookie访问网站
import cookielib, urllib2
cookiejar = cookielib.CookieJar()
urlOpener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookiejar))
values = {'redirect':", 'email':'abc@abc.com',
'password':'password', 'rememberme':", 'submit':'OK, Let Me In!'}
data = urllib.urlencode(values)
request = urllib2.Request(url, data)
url = urlOpener.open(request)
print url.info()
page = url.read()
request = urllib2.Request(url)
url = urlOpener.open(request)
page = url.read()
print page