为什么 python2.7 下载页面 页面没有表头?
# coding:utf8
import urllib2
class HtmlDownloder(object):
def download(self, url):
if url is None:
return None
response = urllib2.urlopen(url)
if response.getcode() != 200:
return None
html = response.read()
print html
return html
解析地址:https://baike.baidu.com/item/Python/407313?fr=aladdin