用python读取web页面信息

import urllib2

req = urllib2.Request("http://localhost:8080")
res = urllib2.urlopen( req )
headers = str(res.info())
print(headers)
html=res.read()
print(html)
posted @ 2009-07-24 17:53  Fan Zhang  阅读(469)  评论(0编辑  收藏  举报