你好,我有一个复杂的JSON对象
[
{
"InvoiceNumberPrefix": "xx-",
"InvoiceNumber": 33333,
"OrderID": 905339301,
"CustomerID": 44334555,
"OrderDate": "2020-07-17T12:58:43",
"OrderStatusID": 1,
"LastUpdate": "2020-07-17T13:02:12",
"UserID": "none",
"SalesPerson": "none",
"AlternateOrderID": "",
"OrderType": "Repeat",
"PaymentTokenID": 0,
"BillingFirstName": "John",
"BillingLastName": "Doe",
"BillingCompany": "3dcart",
"BillingAddress": "1234 Test St.",
"BillingAddress2": "",
"BillingCity": "Tamarac",
"BillingState": "FL",
"BillingZipCode": "33321",
"BillingCountry": "US",
"BillingPhoneNumber": "33444444",
"BillingOnLinePayment": false,
"BillingPaymentMethodID": "177"}
]
我试图在对象中找到特定的值。最初我只能指定关键点的位置,但问题是对象可能会很复杂,具有不同的关键点位置。有没有办法找到一个特定的值?例如,如果我试图查看JSON对象中是否包含“33333”,那么最好的方法是什么
假设您已将JSON解析为Python中的变量
data
(字典列表),您可以执行以下操作:如果您只想检查转换后的json dict的值中是否有变量,则可以执行以下操作:
相关问题 更多 >
编程相关推荐