Content of infobox of Wikipedia

前端 未结 3 1627
轮回少年
轮回少年 2020-12-09 23:18

I need to get the content of an infobox of any movie. I know the name of the movie. One way is to get the complete content of a Wikipedia page and then parse it until I find

3条回答
  •  一整个雨季
    2020-12-09 23:38

    You can get the wikipage content with pywikipdiabot, and then, you can search for the infobox with regex, a parser like mwlib [0], or even stick with pywikipediabot and use one of his template tools. For example on textlib you'll find some functions to deal with templates (hint: search for "# Functions dealing with templates"). [1]

    [0] - http://pypi.python.org/pypi/mwlib

    [1] - http://svn.wikimedia.org/viewvc/pywikipedia/trunk/pywikipedia/pywikibot/textlib.py?view=markup

提交回复
热议问题