python (爬虫urllib、request)最简单的爬虫网页

# Author: Sooele

from urllib import request

def f(url):
    print('GET: %s' % url)
    resp = request.urlopen(url)
    data = resp.read()
    f = open("url.html","wb")
    f.write(data)
    f.close()
    print('%d bytes received from %s.' % (len(data), url))


f("https://www.sooele.com")

发表评论