How to get the Infobox data from Wikipedia?

后端 未结 8 1341
感动是毒
感动是毒 2020-11-28 10:47

If I have the url to a page, how would I obtain the Infobox information on the right using MediaWiki webservices?

相关标签:
8条回答
  • 2020-11-28 11:27

    In our project we use queries for fetching data from wiktionary like this:

    http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20html%20where%20url%3D%22http%3A%2F%2Fen.wiktionary.org%2Fwiki%2Flife%22%20and%20xpath%3D'%2F%2Fdiv%5B%40id%3D%22bodyContent%22%5D'&format=xml&diagnostics=false&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback=recwiki
    

    I have no comprehensive understanding of it, but it works. Output result can de filtered using jquery or something else.

    0 讨论(0)
  • 2020-11-28 11:28

    Using MediaWiki, you can view the infobox on the right of a Wikipedia page by using this link below. As you see, the format is in JSON (can be changed) and by changing the "hydrogen" word to the specific title you want you will get an page with an infobox.

    https://en.wikipedia.org/w/api.php?action=parse&page=Template:Infobox%20hydrogen&format=json

    0 讨论(0)
提交回复
热议问题