mediawiki

Get Text Content from mediawiki page via API

早过忘川 提交于 2019-11-26 15:19:18
问题 I'm quite new to MediaWiki, and now I have a bit of a problem. I have the title of some Wiki page, and I want to get just the text of a said page using api.php , but all that I have found in the API is a way to obtain the Wiki content of the page (with wiki markup). I used this HTTP request... /api.php?action=query&prop=revisions&rvlimit=1&rvprop=content&format=xml&titles=test But I need only the textual content, without the Wiki markup. Is that possible with the MediaWiki API? 回答1: I don't

How to use wikipedia api if it exists? [closed]

空扰寡人 提交于 2019-11-26 10:07:08
问题 I\'m trying to find out if there\'s a wikipedia api (I Think it is related to the mediawiki?). If so, I would like to know how I would tell wikipedia to give me an article about the new york yankees for example. What would the REST url be for this example? All the docs on this subject seem fairly complicated. 回答1: You really really need to spend some time reading the documentation, as this took me a moment to look and click on the link to fix it. :/ but out of sympathy i'll provide you a link

How to get the Infobox data from Wikipedia?

百般思念 提交于 2019-11-26 09:45:27
问题 If I have the url to a page, how would I obtain the Infobox information on the right using MediaWiki webservices? 回答1: Maybe a little late but i wanted the same thing and didn't see any easy solutions here, but (as Bryan points out) it turns out not to be too difficult to use the Mediawiki API with this library: https://github.com/siznax/wptools Usage: >>> import wptools >>> so = wptools.page('Stack Overflow').get_parse() >>> so.infobox {'alexa': '{{DecreasePositive}}', 'author': '[[Joel