Skip to content
Advertisement

python read a specific json

I’m trying to read this json. I need values: PoolID, PoolSystemCapacityGb2,NumPagesUsedPool, and others..

But i can only read values for the ‘PooID’:1, not for the PooID’:90

How can i parse this kind of json?

JavaScript

My code:

JavaScript

thanks for help.

Advertisement

Answer

If you need to get all objects from JSON with some specific key, you will need to traverse all elements. This way, for example:

JavaScript

Output:

JavaScript
Advertisement