#!coding:utf-8# 获取web页面import sys,urllib2 req=urllib2.Request(sys.argv[1]) fd=urllib2.urlopen(req) while 1: data=fd.read() if not len(data): break print data
#coding:utf-8 import sys,urllib2 req=urllib2.Request(sys.argv[1]) fd=urllib2.urlopen(req) print "url:",fd.geturl() print "info:",fd.info()
时间: 2024-10-11 11:01:42