ModuleNotFoundError: No module named 'request' 报这个错
2017-06-21
utf-8是unicode的实现方式,就是对unicode的优化实现,为了节约存储空间,所以encode('utf-8')可以包含各种语言。
2017-06-14
import urllib.request
import urllib.parse
req = urllib.request.Request("")
postdata=urllib.parse.urlencode([("a":"b"),...])
req.add_header("c":"d")
resp = urllib.request.urlopen(req,data=postdata.encode('utf-8'))
print(resp.read().decode("utf-8"))
#展示网页
import urllib.parse
req = urllib.request.Request("")
postdata=urllib.parse.urlencode([("a":"b"),...])
req.add_header("c":"d")
resp = urllib.request.urlopen(req,data=postdata.encode('utf-8'))
print(resp.read().decode("utf-8"))
#展示网页
2017-06-06
#python3.4要import request
import urllib.request
resp = urllib.request.urlopen("http://www.baidu.com")
print(resp.read().decode("utf-8"))
import urllib.request
resp = urllib.request.urlopen("http://www.baidu.com")
print(resp.read().decode("utf-8"))
2017-06-06