|
50精币
[{"id":1,"itemCode":"2402020800765","itemId":"597469089909","itemIdAndCode":{"itemCode":"2402020800765","itemId":"597469089909"},"itemName":"进口花王浴室清洁剂玫瑰香1L","itemProp":{"areaSale":true,"batchInfo":[{"batchCode":"520000005113123"}],"lockupDays":273,"measureGoods":false,"skuDisclaimer":false},"itemVolume":"1350","itemWeight":"1200","lackType":"","measureGoods":false,"outerSpuId":"597646734875","outerSpuIdAndName":{"outerSpuId":"597646734875","outerSpuName":"进口花王浴室清洁剂神器玻璃瓷砖强力去污除垢防霉除菌魔术灵2瓶"},"outerSpuName":"进口花王浴室清洁剂神器玻璃瓷砖强力去污除垢防霉除菌魔术灵2瓶","planQuantity":1,"precious":{"precious":false,"value":"-"},"price":"55.67","realQuantity":1},{"id":2,"itemCode":"6928820085622","itemId":"549659059293","itemIdAndCode":{"itemCode":"6928820085622","itemId":"549659059293"},"itemName":"【天猫超市】L'oreal/欧莱雅欧莱雅茶树植萃去屑净油洗发露500ml 500ml","itemProp":{"areaSale":true,"batchInfo":[{"batchCode":"520000007415173"}],"lockupDays":273,"measureGoods":false,"skuDisclaimer":false},"itemVolume":"1030","itemWeight":"568","lackType":"","measureGoods":false,"outerSpuId":"549616687040","outerSpuIdAndName":{"outerSpuId":"549616687040","outerSpuName":"欧莱雅美发茶树植萃去屑控油洗发水女无硅油去屑止痒洗发水露正品"},"outerSpuName":"欧莱雅美发茶树植萃去屑控油洗发水女无硅油去屑止痒洗发水露正品","planQuantity":1,"precious":{"precious":false,"value":"-"},"price":"48.37","realQuantity":1},{"id":3,"itemCode":"6947230500839","itemId":"597730042323","itemIdAndCode":{"itemCode":"6947230500839","itemId":"597730042323"},"itemName":"利得加厚背心垃圾袋50cm*60cm*100只家用垃圾袋分类","itemProp":{"areaSale":true,"batchInfo":[{"batchCode":"520000005894740"}],"lockupDays":456,"measureGoods":false,"skuDisclaimer":false},"itemVolume":"756","itemWeight":"380","lackType":"","measureGoods":false,"outerSpuId":"597919467521","outerSpuIdAndName":{"outerSpuId":"597919467521","outerSpuName":"利得加厚背心垃圾袋50cm*60cm*100只家用一次性垃圾袋分类厨房"},"outerSpuName":"利得加厚背心垃圾袋50cm*60cm*100只家用一次性垃圾袋分类厨房","planQuantity":1,"precious":{"precious":false,"value":"-"},"price":"7.66","realQuantity":1}]
上面是json内容
问题是:如何一次性分别取出所有outerSpuName":" 、 price":" 这两个值得内容。
|
最佳答案
查看完整内容
[e=0].版本 2
.支持库 spec
.局部变量 json, 类_json
.局部变量 n, 整数型
.局部变量 outerSpuName, 文本型
.局部变量 price, 文本型
json.解析 (#常量1)
.计次循环首 (json.成员数 (“”), n)
outerSpuName = json.取通用属性 (“[” + 到文本 (n - 1) + “].outerSpuIdAndName.outerSpuName”)
price = json.取通用属性 (“[” + 到文本 (n - 1) + “].price”)
调试输出 (outerSpuName, price)
.计次循环 ...
求助知识:请将问题描述清楚,最好把你有问题的源码打包上传上来,这样更方便大家帮助你。 友情提醒:本版被采纳的主题可在 申请荣誉值 帖子申请荣誉值,获得 3点 荣誉值,荣誉值可兑换荣誉会员、终身vip用户组。
|