2

I want to get a content page from Wiki in this format (the picture below) then show it in WebView. It means the content includes text and links.

Einstein

I tried this but the output seems to be messy. http://en.wikipedia.org/w/api.php?action=query&prop=revisions&rvprop=content&titles=Albert_Einstein&format=xmlfm

Damjan Pavlica
  • 31,277
  • 10
  • 71
  • 76
emeraldhieu
  • 9,380
  • 19
  • 81
  • 139

3 Answers3

5

I stumbled across this answer a year later and would like to note that the ?action=render parameter has been depreciated as of this post.

The recommended method is to use the Mediawiki API to parse the wikitext.

ckoerner
  • 51
  • 2
  • 6
4

You want index.php?action=render; an example. This returns the HTML of the page content with no sidebar/header/footer HTML. You'll have to match and remove infoboxes yourself.

Reference: MediaWiki — Manual:Parameters to index.php.

Kevin Reid
  • 37,492
  • 13
  • 80
  • 108
0

You can use HTML generated by mediawiki instead of wikicode.

BTW: look at this

Bulwersator
  • 53
  • 1
  • 5