You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thing is I believe (I might be wrong), that mwclient preloads the article text when accessing to Page object, sending a new request would be an overhead :)
defisthereanimage(article):
"""Returns whether there is an image in the article or not."""LOG.info("Analyzing: %s", article.name.encode('utf-8'))
result=site.api('query', prop='pageimages', titles=article.name.encode('utf-8'))
...
# test result length :-)
Something a bit more clever would be to try to do all the queries in one with something like
Exemple of usage
https://fr.wikipedia.org/w/api.php?action=query&formatversion=2&prop=pageimages&titles=Nicolas%20Sarkozy
https://fr.wikipedia.org/w/api.php?action=query&formatversion=2&prop=pageimages&titles=Antoine%20Waechter
The text was updated successfully, but these errors were encountered: