爬虫初试
Posted brownyangyang
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了爬虫初试相关的知识,希望对你有一定的参考价值。
# -*- coding:utf-8 -*- # Author:Brownyangyang from urllib import request def f(url): print(‘GET:%s‘ % url) resp = request.urlopen(url) data = resp.read() print("%d bytes received from %s"% (len(data),url)) f = open("url.html","wb") f.write(data) f.close() print(‘%d bytes received from %s.‘ %(len(data),url)) f("http://www.cnblogs.com/brownyangyang/p/8926478.html")
以上是关于爬虫初试的主要内容,如果未能解决你的问题,请参考以下文章