擅长:python、mysql、java
<p>你得先浏览一下字典<code>CategoryParentID</code>在一个列表中(因此<code>[0]</code>),它的值是<code>Category</code>,它的值是<code>CategoryArray</code></p>
<pre><code>dicstr = {'CategoryCount': '12842',
'UpdateTime': '2018-04-10T02:31:49.000Z',
'Version': '1057',
'Ack': 'Success',
'Timestamp': '2018-07-17T18:33:40.893Z',
'CategoryArray': {'Category': [{'CategoryName': 'Antiques',
'CategoryLevel': '1',
'AutoPayEnabled': 'true',
'BestOfferEnabled': 'true',
'CategoryParentID': '20081',
'CategoryID': '20081'}]
}
}
dicstr['CategoryArray']['Category'][0]['CategoryParentID']
'20081'
</code></pre>