urllib是URL处理模块,包括:
urllib.request
用于打开和阅读URLurllib.error
包含由...提出的例外urllib.parse
用于解析URLurllib.robotparser
用于解析robots.txt
文件
urllib.request.urlopen(url,data = None,[ timeout,] *,cafile = None,capath = None,cadefault = False,context = None )
urllib.request.request(url,data = None,headers = {},origin_req_host = None,unverifiable = False,method = None )