如何从json角度检索键和值

时间:2018-08-06 06:07:04

标签: angular

我的json如下。我需要从

检索密钥作为'test'
((vcap.services.kafka.credentials.credential_8.name":"test") and value as testvalue from (vcap.services.kafka.credentials.credential_8.value":"testvalue")

    "vcap":{"vcap.services.site.volume_mounts":"",
             "vcap.services.kafka.credentials.credential_8.name":"test",
             "vcap.services.mq.credentials.credential_5.name":"A",
             "vcap.services.mq.credentials.credential_5.value":"Avalue",
             "vcap.services.kafka.credentials.credential_8.value":"testvalue"
           }

示例代码确实很有价值。

1 个答案:

答案 0 :(得分:0)

请尝试以下代码。

unique_id = [a['href'] for a in table.select('a[href]')]