我想将json的返回值逐个单元格添加到excel中,例如
2003-1 2003-2 2003-3 2003-4 2003-5 2003-6 2003-7 2003-8 2003-9 ....
number number number number number number number number number ....
这是我的代码,但可以理解它只粘贴到第一个单元格,我无法构建我想要的系统。先感谢您..
from xlwings import Workbook, Sheet, Range, Chart
import requests
import json
payload = {'cityId':3969, 'lbDistricts':599, 'criter':149,'startdate':'2003-01','cmd':'result','areaCode':18439}
url = "https://www.garantimortgage.com/apps/Socket/Webservice.ashx"
r = requests.post(url, data=payload)
wb = Workbook()
data = json.loads(r.text)
data = map(dict.values, data[u'output'][u'resultset'][u'record'][u'data'])
for row in data:
Range("A1").value = '{:10}{:10}'.format(*row)