Em có một dict như thế này. Thực chất nó là những cái list và dict lồng nhau, nhưng mà khó chịu ở chỗ một số dict/list lồng bên trong lại được viết ở dạng string:
{"data":"[
{
\"ScheduleId\":\"8718142a-c6bd-4e71-9c33-590e1be8ede6\",
\"NOC\":0,
\"RegistrationId\":\"00000000-0000-0000-0000-000000000000\",
\"Medal\":3,
\"Record\":\"\",
\"ScheduleInfo\":\"{
\\\"EventId\\\":\\\"00000000-0000-0000-0000-000000000000\\\",
\\\"CategoryId\\\":\\\"00000000-0000-0000-0000-000000000000\\\",
\\\"Name\\\":\\\"Malaysia - Vietnam\\\",
\\\"Description\\\":\\\"Lower Bracket Semi - Final\\\",
\\\"StartTime\\\":\\\"2022-05-22T09:00:00\\\",
\\\"EndTime\\\":\\\"2022-05-22T11:45:00\\\",
\\\"PlaceId\\\":\\\"14f11f4e-b5ad-4666-bd1c-c780a5028ef8\\\",
\\\"PlaceName\\\":\\\"Trung tâm Hội nghị Quốc gia\\\",
\\\"StartingList\\\":\\\"[
\\\\\\\"195fe76a-3d28-4d0e-b8c1-095890f59252\\\\\\\",
\\\\\\\"88ee495c-2af6-47dc-b352-0c735538e021\\\\\\\",
\\\\\\\"9d8fbfbb-f3c3-46db-a395-a6b3e29a4f1b\\\\\\\",
\\\\\\\"94c96690-7ab1-4c86-8b76-b0911dc153ca\\\\\\\",
\\\\\\\"28d2c889-f32e-4b7e-9255-36dd3fdd1497\\\\\\\",
\\\\\\\"3ecc9463-e350-4851-842f-dec5818e4f05\\\\\\\",
\\\\\\\"845d9dfb-2506-4564-8550-c4f808752d30\\\\\\\",
\\\\\\\"9ab4b53a-0ade-4531-99fc-6df1a7098999\\\\\\\",
\\\\\\\"1abe1fea-d2bd-4e3d-8c05-d837b39c34ca\\\\\\\",
\\\\\\\"2da72008-1c91-47f0-934d-aa1eec8a4802\\\\\\\"
]\\\",
\\\"TotalRows\\\":0,
\\\"ObjectType\\\":0,
\\\"Id\\\":\\\"8718142a-c6bd-4e71-9c33-590e1be8ede6\\\",
\\\"TenantId\\\":1076,
\\\"WorkgroupId\\\":0,
\\\"Status\\\":3,
\\\"Active\\\":True,
\\\"CreatedDate\\\":\\\"2022-05-22T08:59:47.477\\\",
\\\"CreatedDateUnixTime\\\":1653209987,
\\\"CreatedBy\\\":33825,
\\\"CreatedByName\\\":\\\"esports\\\",
\\\"LastEditedDate\\\":\\\"2022-05-22T13:11:32.877\\\",
\\\"LastEditedDateUnixTime\\\":1653225092,
\\\"LastEditedBy\\\":37218,
\\\"LastEditedByName\\\":\\\"competition_admin\\\",
\\\"ProfileData\\\":{
\\\"Description_vi\\\":\\\"Chung kết nhánh thua\\\",
\\\"Discipline\\\":\\\"\\\",
\\\"Event\\\":\\\"Arena of Valor (Mobile) - Team Event\\\",
\\\"EventId\\\":\\\"462\\\",
\\\"Ext1\\\":\\\"BO5\\\",
\\\"Ext2\\\":\\\"\\\",
\\\"Ext3\\\":\\\"\\\",
\\\"IndividualTeam\\\":\\\"[
{
\\\\\\\"Team\\\\\\\":0,
\\\\\\\"TeamId\\\\\\\":1,
\\\\\\\"RegistrationIds\\\\\\\":[
\\\\\\\"195fe76a-3d28-4d0e-b8c1-095890f59252\\\\\\\",
\\\\\\\"88ee495c-2af6-47dc-b352-0c735538e021\\\\\\\",
\\\\\\\"9d8fbfbb-f3c3-46db-a395-a6b3e29a4f1b\\\\\\\",
\\\\\\\"94c96690-7ab1-4c86-8b76-b0911dc153ca\\\\\\\",
\\\\\\\"28d2c889-f32e-4b7e-9255-36dd3fdd1497\\\\\\\"
]
},
{
\\\\\\\"Team\\\\\\\":1,
\\\\\\\"TeamId\\\\\\\":1,
\\\\\\\"RegistrationIds\\\\\\\":[
\\\\\\\"3ecc9463-e350-4851-842f-dec5818e4f05\\\\\\\",
\\\\\\\"845d9dfb-2506-4564-8550-c4f808752d30\\\\\\\",
\\\\\\\"9ab4b53a-0ade-4531-99fc-6df1a7098999\\\\\\\",
\\\\\\\"1abe1fea-d2bd-4e3d-8c05-d837b39c34ca\\\\\\\",
\\\\\\\"2da72008-1c91-47f0-934d-aa1eec8a4802\\\\\\\"
]
}
]\\\",
\\\"Name_vi\\\":\\\"Malaysia - Vietnam\\\",
\\\"Noc1\\\":\\\"868\\\",
\\\"Noc2\\\":\\\"858\\\",
\\\"Sport\\\":\\\"eSports\\\",
\\\"Results\\\":\\\"[
{
\\\\\\\"NOC\\\\\\\":\\\\\\\"868\\\\\\\",
\\\\\\\"RegistrationId\\\\\\\":\\\\\\\"00000000-0000-0000-0000-000000000000\\\\\\\",
\\\\\\\"Session\\\\\\\":\\\\\\\"{
\\\\\\\\\\\\\\\"key\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\"col1\\\\\\\\\\\\\\\",
\\\\\\\\\\\\\\\"name\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\"Chung cuộc\\\\\\\\\\\\\\\"
}\\\\\\\",
\\\\\\\"MatchId\\\\\\\":None,
\\\\\\\"Result\\\\\\\":\\\\\\\"0\\\\\\\",
\\\\\\\"IsPass\\\\\\\":False,
\\\\\\\"Note\\\\\\\":\\\\\\\"0\\\\\\\",
\\\\\\\"Medal\\\\\\\":0,
\\\\\\\"Record\\\\\\\":\\\\\\\"\\\\\\\",
\\\\\\\"Card1\\\\\\\":\\\\\\\"\\\\\\\",
\\\\\\\"Card2\\\\\\\":\\\\\\\"\\\\\\\"
},
{
\\\\\\\"NOC\\\\\\\":\\\\\\\"868\\\\\\\",
\\\\\\\"RegistrationId\\\\\\\":\\\\\\\"00000000-0000-0000-0000-000000000000\\\\\\\",
\\\\\\\"Session\\\\\\\":\\\\\\\"\\\\\\\",
\\\\\\\"MatchId\\\\\\\":None,
\\\\\\\"Result\\\\\\\":\\\\\\\"\\\\\\\",
\\\\\\\"IsPass\\\\\\\":False,
\\\\\\\"Note\\\\\\\":\\\\\\\"0\\\\\\\",
\\\\\\\"Medal\\\\\\\":3,
\\\\\\\"Record\\\\\\\":\\\\\\\"\\\\\\\",
\\\\\\\"Card1\\\\\\\":\\\\\\\"\\\\\\\",
\\\\\\\"Card2\\\\\\\":\\\\\\\"\\\\\\\"
},
]\\\",
\\\"ResultsPhoto\\\":\\\"[]\\\"
}
}\"
}
]"
}
Em muốn xử lý mấy cái string đó để có thể truy cập dễ dàng hơn bằng code. Như thế này:
{"data":[
{
"ScheduleId":"8718142a-c6bd-4e71-9c33-590e1be8ede6",
"NOC":0,
"RegistrationId":"00000000-0000-0000-0000-000000000000",
"Medal":3,
"Record":"",
"ScheduleInfo":{
"EventId":"00000000-0000-0000-0000-000000000000",
"CategoryId":"00000000-0000-0000-0000-000000000000",
"Name":"Malaysia - Vietnam",
"Description":"Lower Bracket Semi - Final",
"StartTime":"2022-05-22T09:00:00",
"EndTime":"2022-05-22T11:45:00",
"PlaceId":"14f11f4e-b5ad-4666-bd1c-c780a5028ef8",
"PlaceName":"Trung tâm Hội nghị Quốc gia",
"StartingList":[
"195fe76a-3d28-4d0e-b8c1-095890f59252",
"88ee495c-2af6-47dc-b352-0c735538e021",
"9d8fbfbb-f3c3-46db-a395-a6b3e29a4f1b",
"94c96690-7ab1-4c86-8b76-b0911dc153ca",
"28d2c889-f32e-4b7e-9255-36dd3fdd1497",
"3ecc9463-e350-4851-842f-dec5818e4f05",
"845d9dfb-2506-4564-8550-c4f808752d30",
"9ab4b53a-0ade-4531-99fc-6df1a7098999",
"1abe1fea-d2bd-4e3d-8c05-d837b39c34ca",
"2da72008-1c91-47f0-934d-aa1eec8a4802"
],
"TotalRows":0,
"ObjectType":0,
"Id":"8718142a-c6bd-4e71-9c33-590e1be8ede6",
"TenantId":1076,
"WorkgroupId":0,
"Status":3,
"Active":True,
"CreatedDate":"2022-05-22T08:59:47.477",
"CreatedDateUnixTime":1653209987,
"CreatedBy":33825,
"CreatedByName":"esports",
"LastEditedDate":"2022-05-22T13:11:32.877",
"LastEditedDateUnixTime":1653225092,
"LastEditedBy":37218,
"LastEditedByName":"competition_admin",
"ProfileData":{
"Description_vi":"Chung kết nhánh thua",
"Discipline":"",
"Event":"Arena of Valor (Mobile) - Team Event",
"EventId":"462",
"Ext1":"BO5",
"Ext2":"",
"Ext3":"",
"IndividualTeam":[
{
"Team":0,
"TeamId":1,
"RegistrationIds":[
"195fe76a-3d28-4d0e-b8c1-095890f59252",
"88ee495c-2af6-47dc-b352-0c735538e021",
"9d8fbfbb-f3c3-46db-a395-a6b3e29a4f1b",
"94c96690-7ab1-4c86-8b76-b0911dc153ca",
"28d2c889-f32e-4b7e-9255-36dd3fdd1497"
]
},
{
"Team":1,
"TeamId":1,
"RegistrationIds":[
"3ecc9463-e350-4851-842f-dec5818e4f05",
"845d9dfb-2506-4564-8550-c4f808752d30",
"9ab4b53a-0ade-4531-99fc-6df1a7098999",
"1abe1fea-d2bd-4e3d-8c05-d837b39c34ca",
"2da72008-1c91-47f0-934d-aa1eec8a4802"
]
}
],
"Name_vi":"Malaysia - Vietnam",
"Noc1":"868",
"Noc2":"858",
"Sport":"eSports",
"Results":[
{
"NOC":"868",
"RegistrationId":"00000000-0000-0000-0000-000000000000",
"Session":{
"key":"col1",
"name":"Chung cuộc"
},
"MatchId":None,
"Result":"0",
"IsPass":False,
"Note":"0",
"Medal":0,
"Record":"",
"Card1":"",
"Card2":""
},
{
"NOC":"868",
"RegistrationId":"00000000-0000-0000-0000-000000000000",
"Session":"",
"MatchId":None,
"Result":"",
"IsPass":False,
"Note":"0",
"Medal":3,
"Record":"",
"Card1":"",
"Card2":""
},
],
"ResultsPhoto":[]
}
}
}
]
}
Nhờ các cao nhân giúp đỡ. Em xin cảm ơn.