2016-11-24 40 views
0

このwikiページhttps://en.wikipedia.org/wiki/Outline_of_academic_disciplinesから分野のリストを抽出したいと思います.Wikipedia APIを使ってどのように行うことができますか?Wikipedia APIを使用してページからコンテンツリストを取得する

私は次のように試してみました:https://en.wikipedia.org/w/api.php?action=parse&page=List_of_action_films_of_the_2010s&contentmodel=wikitext&prop=wikitext&format=json

が、これは記事の最初のセクションを取得し、私は内容の部分を取得したいので、結果はこのようなものになります。

{ 
Arts : { 
"Performing Arts" : [all its sub-child], 
"Visual arts" : [all its sub-child] 
} 
Geography: {....} 

} 

これはWikipedia APIを使って可能ですか?

答えて

1

action=parse&format=json&page=Outline_of_academic_disciplines&prop=sections

"sections": [ 
     { 
      "toclevel": 1, 
      "level": "2", 
      "line": "Arts", 
      "number": "1", 
      "index": "1", 
      "fromtitle": "Outline_of_academic_disciplines", 
      "byteoffset": 1241, 
      "anchor": "Arts" 
     }, 
     { 
      "toclevel": 2, 
      "level": "3", 
      "line": "Performing arts", 
      "number": "1.1", 
      "index": "2", 
      "fromtitle": "Outline_of_academic_disciplines", 
      "byteoffset": 1279, 
      "anchor": "Performing_arts" 
     }, 
     ... 
関連する問題