#将str类型转换为bytes类型 data = urllib.parse.urlencode(formData).encode(“utf-8”)
request = urllib.request.Request(url, data=data, headers=header)
print(urllib.request.urlopen(request).read().decode(“utf-8”))
上一篇:python报错:module ‘urllib’ has no attribute ‘request’解决办法
下一篇:Python进度条tqdm的使用