import requests
from openpyxl import workbook
res = requests.get("http://www.10086.cn/support/selfservice/help/sh/5010801_4073_8801.json")
data_list = res.json()
data_list = data_list["cData"]["list"]
wb = workbook.Workbook()
sheet = wb.worksheets[0]
row_index = 1
for item in data_list:
question = item["question"]
answer = item["answer"]
orderId = item["_orderId"]
cell1 = sheet.cell(row_index, 1)
cell1.value = question
cell2 = sheet.cell(row_index, 2)
cell2.value = answer
cell3 = sheet.cell(row_index, 3)
cell3.value = orderId
row_index = row_index + 1
wb.save("question.xlsx")