废话不多数,直接来贴图,上代码,
提取指定的productName print(dict3['data'][1]['product']['productName']) 提取所有的productName 方法一: for i in dict3['data']: if 'product' in i: for key, value in i.items(): if key == 'product': print(value['productName']) 方法二: displayNameList=[] for i in dict3["data"]: for k,v in i["product"].items(): if k =="productName": displayNameList.append(v) print(displayNameList) 方法三 for i in dict3['data']: if 'product' in i: print(i['product']['productName'])