import jsonpath
import json data = "{\"a\": \"11\", \"c\": {\"a\": true}}"
data = json.loads(data)
expr = "$.c.a"
expr_1 = "$.c.b"
result = jsonpath.jsonpath(data, expr)
result_1 = jsonpath.jsonpath(data, expr_1)
print(result)
print(result_1)

 需要注意的是:

jsonpath 一个简单实用的工具-LMLPHP

05-28 09:11