2012-11-19 45 views

回答

2

你想要的不是頁面列表,所以它不在你鏈接的頁面上。但可以檢索某個頁面的部分標題列表。爲此,您使用action=parseprop=sections

例如,http://en.wikipedia.org/w/api.php?format=xml&action=parse&prop=sections&page=Chicago回報

<api> 
    <parse title="Chicago"> 
     <sections> 
      <s toclevel="1" level="2" line="History" number="1" index="1" fromtitle="Chicago" byteoffset="8123" anchor="History"/> 
      <s toclevel="2" level="3" line="Rapid growth and development" number="1.1" index="2" fromtitle="Chicago" byteoffset="12922" anchor="Rapid_growth_and_development"/> 
      <s toclevel="2" level="3" line="20th and 21st centuries" number="1.2" index="3" fromtitle="Chicago" byteoffset="21558" anchor="20th_and_21st_centuries"/> 
      <s toclevel="1" level="2" line="Geography" number="2" index="4" fromtitle="Chicago" byteoffset="28176" anchor="Geography"/> 
      … 
+0

大。非常感謝。 – user1836601

相關問題