问题
I'm trying to get lead actor's name from movie's Wikipedia article.
I tried different values for prop, prop=info seems most relevant. But this doesn't contain the information in info box of Wikipedia article.
See:
http://en.wikipedia.org/w/api.php?action=query&prop=info&titles=Casino_Royale_(2006_film)&format=jsonfm
Is it possible to extract information in infobox using Wikipedia API?
回答1:
The MediaWiki API doesn't understand infoboxes. So, you have basically two options:
- Parse the infobox yourself. You can either parse the wikitext directly or the generated HTML table (both are available from the API).
- Let somebody else do the parsing. This is exactly what DBPedia does. Wikidata tries to do something similar, but it probably won't contain enough data to be usable for a long time; see growth statistics.
来源:https://stackoverflow.com/questions/18327768/how-to-get-information-in-info-box-of-wikipedia-articles-using-wikipedia-api