2021年5月7日星期五

How to get this value from this enormous list inside a dict inside a list that is inside dict...?

i'm learning python and some webscraping techniques. I made a request from a website and i want to get a value from this confuse dict:

newDict = {'actions': [{'account_action_seq': 3186, 'action_trace': {'account_ram_deltas': [], 'act': {'account': 'test', 'authorization': [{'actor': 'test', 'permission': 'xfer'}], 'data': {'from': 'm.federation', 'm  emo': 'test', 'quantity': '0.0442', 'to': 'test'}, 'hex_data': 'test', '  name': 'transfer'}, 'action_ordinal': 5, 'block_num': 117988314, 'block_time': 'test', 'closest_unnotified_ancestor_action_ordinal': 2, 'context_free': False, 'creator_action_ordinal': 2, 'elapsed': 2, 'p  roducer_block_id': 'test', 'receipt': {'abi_sequence': 4, 'act_digest': 'test', 'auth_sequence': [['m.f  ederation', 2]], 'code_sequence': 5, 'global_sequence': 4798388072, 'receiver': 'test', 'recv_sequence': 1514}, 'receiver': 'pvwbq.wam', 'trx_id': '3'}, 'block_num': 117988314, 'block_time': '2021-05-08T00:56:14.000', 'global_action_seq': 4798388072, 'irreversible': True}], 'head_block_num': 117989564, 'last_irreversible_block': 117989233}  

I want to print the value in 'quantity' that is 0.0442 but i don't know how to get to it. Please help me xD

https://stackoverflow.com/questions/67443236/how-to-get-this-value-from-this-enormous-list-inside-a-dict-inside-a-list-that-i May 08, 2021 at 09:18AM

没有评论:

发表评论