def get_infos(params, adr):
data = urllib.urlencode(params)
req = urllib2.Request(adr, data)
try:
response = urllib2.urlopen(req)
except urllib2.HTTPError, e:
print e
return False
except urllib2.URLError, e:
print e
return False
except httplib.HTTPException, e:
print e
return False
read_resp = response.read()
if len(read_resp) > 0:
return json.loads(read_resp)
else:
return False
评论列表
文章目录