urllib实现http客户端功能
urllib.request 最长用的模块,可以用了发送和获取request的结果
request用法案例
爬取网页
>>> from urllib import request
>>> url = 'http://www.qq.com'
>>> html = request.urlopen(url)
>>> html.readline()
b'<html>\n'
>>> html.read(20)
b'<head>\n<meta http-eq'
>>> html.readlines()