I want to get main image from wikipedia page, I have all wikipedia entity name from which I create wiki link and getting main image from that page.
I tried with
https://github.com/richardasaurus/wiki-api, https://github.com/goldsmith/Wikipedia
But this does not work on all pages though page contains image.
from wikiapi import WikiApi
wiki = WikiApi()
wiki = WikiApi({ 'locale' : 'es'})
def getWikiImage(entity):
results = wiki.find(entity)
print results
if len(results):
article = wiki.get_article(results[0])
print article.image
#getWikiImage("Rudy Sarzo")
getWikiImage("Melody Gersbach")
mediawiki api at http://www.mediawiki.org/wiki/API:Client_code#Python I checked out, but does not seem to help.