def get_source(url):
"""Return the source of the supplied url argument"""
http = httplib2.Http()
try:
status, response = http.request(url,
headers={'User-Agent':' Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0'})
if status.status == 200:
return response
else:
return None
except httplib2.HttpLib2Error as e:
return None
评论列表
文章目录