python爬虫笔记,urllib.request模块的运用方法
1. urllib.request模块1.1 版本python2 :urllib2、urllibpython3 :把urllib和urllib2合并,urllib.request1.2 常用的方法urllib.request.urlopen(" 网址") 作 :向网 站发起 一个请求并 获取响应字节流 = response.read()字符串 = response.read().decode("utf-8")urllib.request.Request" 网址",headers="字典")
原创
2020-06-13 21:21:57 ·
723 阅读 ·
0 评论