import requests
import json
url = ‘http://www.kfc.com.cn/kfccda/ashx/GetStoreList.ashx’
headers = {
‘User-Agent’: ‘Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36’
}
kw = input(‘Please enter:’)
data = {
‘keyword’: kw,
‘pageIndex’: ‘1’,
‘pageSize’: ‘10’
}
response = requests.post(url = url, data = data, headers = headers)
response.encoding = response.apparent_encoding
#print(type(response.text))
value_ = response.text
fp = open(kw + ‘.json’, mode = ‘w’, encoding = ‘utf-8’)
json.dump(value_, fp = fp, ensure_ascii = False)
请哪位大佬看看,为啥文件显示-1000?