"UserTable" : {
"abcd@gmailcom" : {
"gameHistory" : {
"G1" : [ {
"category" : "1",
"questiontext" : "What is the cube of 2 ?"
}, {
"category" : "2",
"questiontext" : "What is the cube of 4 ?"
} ]
},
"gamesplayed" : 2
},
"xyz@gmailcom" : {
"gameHistory" : {
"G1" : [ {
"category" : "1",
"questiontext" : "What is the cube of 2 ?"
}, {
"category" : "2",
"questiontext" : "What is the cube of 4 ?"
} ]
},
"gamesplayed" : 2
}
}
Here is the code I have given to access the mail id.
for user in jp.match("$.UserTable[*].[0]", game_data):
print("User ID's {}".format(user_id))
And the error i am getting is:
print(parser.ExtentedJsonPathParser().parse("$.*.gamesplayed").find(gd_info)