import requests
import json
url = 'https://movie.douban.com/j/chart/top_list'
param = {
'type': '24',
'interval_id': '100:90',
'action':'',
'start': '0',
'limit': '20',
}
headers = {
'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1'
}
response = requests.get(url=url,params=param,headers=headers)
list_data = response.josn()
fp = open('./douban.json','w',encoding='utf-8')
json.dump(list_data,fp=fp,ensure_ascii=False)
print('='*10 + '下载完成' + '='*10)
使用requests库的时候 报错 AttributeError: 'Response' object has no attribute 'josn' 百度搜索了下答案,都是说requests库版本太老旧的原因导致的,可我这是 requests 2.28.0啊 ,请问这是什么原因报错呢?