#爬虫程序
import urllib2
def fetch(url):
http_header = {'User-Agent': 'Chrome'}
http_request = urllib2.Request(url, None, http_header)
print "Start downloading data..."
http_response = urllib2.urlopen(http_request)
print "Finish downloading data..."
print http_response.code
print http_response.info()
print "---------------data---------------"
print http_response.open()
if __name__ == "__main__":
fetch("http://www.baidu.com")
python爬虫
最新推荐文章于 2025-06-23 09:41:48 发布