How to parse Json data with many variables?

  • Thread starter Thread starter Mattia Fanti
  • Start date Start date
M

Mattia Fanti

Guest
How can I parse Json code with differents variable but with the same id. I'll explain, Im new using Json, so I want to parse :

"title": {
"runs": [
{
"text": "Peter Tosh - Legalize It"
}
],
"accessibility": {
"accessibilityData": {
"label": "Peter Tosh - Legalize It by Bondade é Nosso Hábito 8 years ago 4 minutes, 46 seconds"
}
}
},
"index": {
"simpleText": "1"
},
"shortBylineText": {
"runs": [
{
"text": "Bondade é Nosso Hábito",
"navigationEndpoint": {
"clickTrackingParams": "CD0QxjQYACITCMn2heSTz-wCFUmw1Qod1hMDdw==",
"commandMetadata": {
"webCommandMetadata": {
"url": "/user/Bruno12170",
"webPageType": "WEB_PAGE_TYPE_CHANNEL",
"rootVe": 3611
}
},
"browseEndpoint": {
"browseId": "UCY1IJY2IYNVfD7R-JbgQGbQ",
"canonicalBaseUrl": "/user/Bruno12170"
}
}
}
]
},
"lengthText": {
"accessibility": {
"accessibilityData": {
"label": "4 minutes, 46 seconds"
}
},
"simpleText": "4:46"
},
"navigationEndpoint": {
"clickTrackingParams": "CD0QxjQYACITCMn2heSTz-wCFUmw1Qod1hMDdzIKcGxwcF92aWRlb1okVkxQTDRfRHg4OGRwdTdlcGZINnlid3FKcGY5dUwydEFsMzY4mgEDEPos",
"commandMetadata": {
"webCommandMetadata": {
"url": "/watch?v=j6QkVTx2d88&list=PL4_Dx88dpu7epfH6ybwqJpf9uL2tAl368&index=1",
"webPageType": "WEB_PAGE_TYPE_WATCH",
"rootVe": 3832
}


What I want to parse from this is:


"text": "Peter Tosh - Legalize It"

"url": "/watch?v=j6QkVTx2d88&list=PL4_Dx88dpu7epfH6ybwqJpf9uL2tAl368&index=1

How can I parse them in a page where there are many elements(songs)? How can I use For each to do so? Thanks

Continue reading...
 
Back
Top