富国沪深
以下data = [{ "took" : 1023, "timed_out" : 'false', "_shards" : { "total" : 5, "successful" : 5, "skipped" : 0, "failed" : 0 }, "hits" : { "total" : 1, "max_score" : 114.88808, "hits" : [ { "_index" : 1, "_type" : "doc", "_id" : 1, "_score" : 114.88808, "_source" : { "message" : "Error something happened" } } ] } }, { "took" : 1023, "timed_out" : 'false', "_shards" : { "total" : 5, "successful" : 5, "skipped" : 0, "failed" : 0 }, "hits" : { "total" : 1, "max_score" : 114.88808, "hits" : [ { "_index" : 2, "_type" : "doc", "_id" : 2, "_score" : 114.88808, "_source" : { "message" : "Something else" } } ] } }]messages = [x['hits']['hits'][0]['_source']['message'] for x in data]print(messages)输出['Error something happened', 'Something else']