wiki

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