Im tring to get the infobox from wiki pages. For this I'm using wiki api. The following is the url from which I'm getting json data.
http://en.wikipedia.org/w/api.php?action=query&prop=revisions&rvprop=content&format=json&titles="+first+"&rvsection=0
Where first is a variable containing the article title for Wikipedia.
I'm finding it extremely complex to parse this data to make a meaningful html out of it.
I was usuing $.each
function initially. But the loop is very deep that I had to use 6-7 times to get to the actual data that I want. I think there would be better alternative than this.
Please help me.
json data for reference
jQuery16209061950308827726_1334683337112({"query":{"pages":{"11039790":{"pageid":11039790,"ns":0,"title":"Animal","revisions":[{"*":"{{Redirect|Animalia}}
{{Other uses}}
{{pp-semi-protected|small=yes}}
{{pp-move-indef}}
{{Taxobox
| color = {{taxobox color|[[animalia]]}}
| name = Animals
| fossil_range = [[Ediacaran]] u2013 Recent {{fossilrange|610|0|}}
| image = Animal diversity.png
| image_width = 250px
| domain = [[Eukaryota]]
{{Taxobox_norank_entry | taxon = [[Opisthokonta]]}}
{{Taxobox_norank_entry | taxon = [[Holozoa]]}}
{{Taxobox_norank_entry | taxon = [[Filozoa]]}}
| regnum = '''Animalia'''
| regnum_authority = [[Carolus Linnaeus|Linnaeus]], [[Systema Naturae|1758]]
| subdivision_ranks = [[Phylum|Phyla]]
| subdivision =
* '''Subkingdom [[Parazoa]]'''
** [[Sponge|Porifera]]
** [[Placozoa]]
* '''Subkingdom [[Eumetazoa]]'''
** '''[[Radiata]] (unranked)'''
*** [[Ctenophora]]
*** [[Cnidaria]]
** '''[[Bilateria]] (unranked)'''
*** [[Orthonectida]]
*** [[Rhombozoa]]
*** [[Acoelomorpha]]
*** [[Chaetognatha]]
*** '''Superphylum [[Deuterostomia]]'''
**** [[Chordata]]
**** [[Hemichordata]]
**** [[Echinoderm]]ata
**** [[Xenoturbellida]]
**** [[Vetulicolia]] [[extinction|u2020]]
*** '''[[Protostomia]] (unranked)'''
**** '''Superphylum [[Ecdysozoa]]'''
***** [[Kinorhyncha]]
***** [[Loricifera]]
***** [[Priapulida]]
***** [[Nematoda]]
***** [[Nematomorpha]]
***** [[Lobopodia]]
***** [[Onychophora]]
***** [[Tardigrada]]
***** [[Arthropoda]]
**** '''Superphylum [[Platyzoa]]'''
***** [[Platyhelminthes]]
***** [[Gastrotricha]]
***** [[Rotifera]]
***** [[Acanthocephala]]
***** [[Gnathostomulida]]
***** [[Micrognathozoa]]
***** [[Cycliophora]]
**** '''Superphylum [[Lophotrochozoa]]'''
***** [[Sipuncula]]
***** [[Hyolitha]] [[extinction|u2020]]
***** [[Nemertea]]
***** [[Phoronida]]
***** [[Bryozoa]]
***** [[Entoprocta]]
***** [[Brachiopoda]]
***** [[Mollusca]]
***** [[Annelida]]
***** [[Echiura]]
}}
'''Animals''' are a major group of multicellular, [[eukaryotic]] [[organism]]s of the [[Kingdom (biology)|kingdom]] '''Animalia''' or '''Metazoa'''. Their [[body plan]] eventually becomes fixed as they [[Developmental biology|develop]], although some undergo a process of [[metamorphosis]] later on in their life. Most animals are [[Motility|motile]], meaning they can move spontaneously and independently. All animals are also [[heterotroph]]s, meaning they must ingest other organisms or their products for [[sustenance]].
Most known animal [[phylum|phyla]] appeared in the fossil record as marine species during the [[Cambrian explosion]], about 542 million years ago."}]}}}})
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…