新人求助啊,
from urllib import request
with request.urlopen('http://api.douban.com/v2/book/2129650') as f:
data = f.read()
print('Status:',f.status,f.reason)
for k,v in f.getheaders():
print('%s:%s'%(k,v))
print(('Data:',data.decode('utf-8')))
用Python3运行这段代码,怎么报错啊,urllib.error.HTTPerror:HTTP Error 400:Bab Reuquest
from urllib import request
with request.urlopen('http://api.douban.com/v2/book/2129650') as f:
data = f.read()
print('Status:',f.status,f.reason)
for k,v in f.getheaders():
print('%s:%s'%(k,v))
print(('Data:',data.decode('utf-8')))
用Python3运行这段代码,怎么报错啊,urllib.error.HTTPerror:HTTP Error 400:Bab Reuquest
