I want to extract data from this nested JSON the text Sunday, Monday, … and display it.
What is the best way to do this?
app.request.json('data.json', function(data) {
var content = data;
//console.log(data);
app.virtualList.create({
el: '.virtual-list',
cache: false,
createUl: false,
items: content,
renderItem(item) {
return `
<p>${item.text}</p>
`;
},
});
})
[
{
"extraction_method": "scrape",
"top": 142.56038,
"left": 66.83375,
"width": 712.9866943359375,
"height": 255.3146514892578,
"data": [
[
{
"top": 0,
"left": 0,
"width": 0,
"height": 0,
"text": "Sunday"
},
{
"top": 142.56038,
"left": 138.07457,
"width": 127.11607360839844,
"height": 22.463668823242188,
"text": "Monday"
}
],
[
{
"top": 165.02405,
"left": 138.07457,
"width": 127.11607360839844,
"height": 31.655975341796875,
"text": "Pizza"
},
{
"top": 165.02405,
"left": 138.07457,
"width": 127.11607360839844,
"height": 31.655975341796875,
"text": "Soup"
}
]
],
"spec_index": 0
}
]