2011-12-13, 20:18
Tried out 0.9.1 from mercurial.
got errors on import cookielibs (rename to cookielib works)
fetchPage with post_data works but I have same problem as with urllib2 the redirect_url doesn't have the querystring I need to fetch.
#using parseDom
urlparams = {CLIENT_ID_KEY: CLIENT_ID_VALUE,
REDIRECTURI: REDURI,
RESPONSETYPE: TOKEN,
SCOPE: NONE_EXPIRY,
DISPLAY: POPUP,
USERNAME_KEY: self.username,
PASSWORD_KEY: self.password}
result = self.common.fetchPage({"link": url,"post_data": urlparams})
print(result["new_url")
> http://www.google.be
#using httplib2
urldata = urllib.urlencode(urlparams)
h = httplib2.Http(disable_ssl_certificate_validation=True)
response, content = h.request(url, 'POST', urldata, headers={'Content-type': 'application/x-www-form-urlencoded'})
print(response['location'])
>http://www.google.be?#access_token=132145647897
any idea ? If this can be solved I can remove httplib2 and only use parseDOM
got errors on import cookielibs (rename to cookielib works)
fetchPage with post_data works but I have same problem as with urllib2 the redirect_url doesn't have the querystring I need to fetch.
#using parseDom
urlparams = {CLIENT_ID_KEY: CLIENT_ID_VALUE,
REDIRECTURI: REDURI,
RESPONSETYPE: TOKEN,
SCOPE: NONE_EXPIRY,
DISPLAY: POPUP,
USERNAME_KEY: self.username,
PASSWORD_KEY: self.password}
result = self.common.fetchPage({"link": url,"post_data": urlparams})
print(result["new_url")
> http://www.google.be
#using httplib2
urldata = urllib.urlencode(urlparams)
h = httplib2.Http(disable_ssl_certificate_validation=True)
response, content = h.request(url, 'POST', urldata, headers={'Content-type': 'application/x-www-form-urlencoded'})
print(response['location'])
>http://www.google.be?#access_token=132145647897
any idea ? If this can be solved I can remove httplib2 and only use parseDOM