摘要:
import urllib.parse 如: url = 'https://www.baidu.com/index?name=xiaoming&age=20' #将标准的url进行编码res = urllib.parse.quote(url) print(res) #结果https%3A//www. 阅读全文
posted @ 2018-06-04 09:28
莫问丶过往
阅读(144)
评论(0)
推荐(0)
摘要:
import urllib.request url = 'http://www.baidu.com/'response = urllib.request.urlopen(url=url) print(response.read().decode()) #默认utf8解码 #直接解码有可能会出现下图错 阅读全文
posted @ 2018-06-04 09:25
莫问丶过往
阅读(119)
评论(0)
推荐(0)

浙公网安备 33010602011771号