编写一个例子respose 就是请求的返回数据
respose = {"errcode": 0,"errmsg": "处理成功","data": {"list": [{"tcode": "","configTemplateId": 14410001,"pageAdjuster": "1"}],"total": 1,"totalPage": 1,"pageNum": 1,"pageSize": 20},"globalTicket": "25-4678668120","monitorTrackId": null
}
json格式提取
configTemplateId = respose.json()['data']['list'][0]['configTemplateId']
jsonpath提取
import jsonpath
configTemplateId = jsonpath.jsonpath(respose.json(),'$.data.list[0].configTemplateId')
参考文章:
https://cloud.tencent.com/developer/article/1784137