python学习之urllib的使用

#urllib库是python内置的HTTP请求库,它主要包括四个模块
#request:用来模拟发送请求
#error:异常处理模块
#parse:url处理,包括解析、拆分、合并等
#robotparser:robots协议,用来识别网站的robots.txt协议
#1、urllib的request模块

1)urlopen()
import urllib.request

response = urllib.request.urlopen("http:")

2)Request

3)高级用法
原文地址:https://www.cnblogs.com/BASE64/p/11045845.html