Iterate over JSON Object using Python

前端 未结 2 1412
-上瘾入骨i
-上瘾入骨i 2021-01-26 02:10

I have a JSON object and was wondering how I can iterate over the object to pull values for \"id\".

{
\"totalSize\": 5,
\"done\": true,
\"records\": [
    {
             


        
2条回答
  •  梦毁少年i
    2021-01-26 02:39

    You can iterate through the records key as a list and then access the Id key of each sub-dict:

    for i in s["records"]:
        print(i['Id'])
    

提交回复
热议问题