How do I grab just the parsed Infobox of a wikipedia article?

后端 未结 8 1678
萌比男神i
萌比男神i 2020-12-16 04:05

I\'m still stuck on my problem of trying to parse articles from wikipedia. Actually I wish to parse the infobox section of articles from wikipedia i.e. my application has re

8条回答
  •  孤街浪徒
    2020-12-16 04:15

    It depends what route you want to go. Here are some possibilities:

    1. Install MediaWiki with appropriate modifications. It is a after all a PHP app designed precisely to parse wikitext...
    2. Download the static HTML version, and parse out the parts you want.
    3. Use the Wikipedia API with appropriate caching.

    DO NOT just hit the latest version of the live page and redo the parsing every time your app wants the box. This is a huge waste of resources for both you and Wikimedia.

提交回复
热议问题