我想從這種格式的Wiki中獲取內容頁面(下圖),然後在WebView中顯示它。這意味着內容包含文字和鏈接。從Wiki頁面獲取整潔的內容。 (MediaWiki API)
我試過,但輸出似乎是混亂的。 http://en.wikipedia.org/w/api.php?action=query&prop=revisions&rvprop=content&titles=Albert_Einstein&format=xmlfm
我想從這種格式的Wiki中獲取內容頁面(下圖),然後在WebView中顯示它。這意味着內容包含文字和鏈接。從Wiki頁面獲取整潔的內容。 (MediaWiki API)
我試過,但輸出似乎是混亂的。 http://en.wikipedia.org/w/api.php?action=query&prop=revisions&rvprop=content&titles=Albert_Einstein&format=xmlfm
你想index.php?action=render
; an example。這將返回頁面內容的HTML,不包含側邊欄/頁眉/頁腳HTML。你必須自己匹配和刪除信息框。
您可以使用由mediawiki生成的HTML代替wikicode。
BTW:看this
一年後,我偶然發現了這個答案,並希望注意到?action=render
參數has been depreciated截至此帖。
推薦的方法是使用Mediawiki API to parse the wikitext。
我看了鏈接,不明白你的意思。 MediaWiki不會生成HTML格式。 – Emerald214
鏈接是關於一般想法「我想從這種格式的Wiki獲取內容頁面」。海量查詢將導致訪問Wikipedia受阻。 – Bulwersator
@HTML - 我想從「bodyContent」div導入html – Bulwersator