2021
04-27
04-27
python urllib库的使用详解
相关:urllib是python内置的http请求库,本文介绍urllib三个模块:请求模块urllib.request、异常处理模块urllib.error、url解析模块urllib.parse。1、请求模块:urllib.requestpython2importurllib2response=urllib2.urlopen('http://httpbin.org/robots.txt')python3importurllib.requestres=urllib.request.urlopen('http://httpbin.org/robots.txt')urllib.request.urlopen(url,data=None,[timeout,]*,cafile=None,c...
继续阅读 >