现在的位置: 首页 > 综合 > 正文

用python读取web页面信息

2011年07月10日 ⁄ 综合 ⁄ 共 144字 ⁄ 字号 评论关闭
import urllib2

req = urllib2.Request("http://localhost:8080")
res = urllib2.urlopen( req )
headers = str(res.info())
print(headers)
html=res.read()
print(html)
【上篇】
【下篇】

抱歉!评论已关闭.