1
這是我的JSON訪問特定節點的JSON
{"sites":[{"site_id":1234,..,..}, {"site_id":5678,..,..}]}
我通過它試圖循環中使用:
for site_id in account['sites']['site_id']:
print(site_id)
其中產量:
list indices must be integers, not str
我可以發誓我做了,但得到了一個錯誤..現在它的工作。我會盡快將其標記爲答案。 –