Search code examples
pythonwikipediawikipedia-apipywikibot

How do I get Wikipedia article text after a certain revision occured?


I am using Pywikibot to get article text from Wikipedia, specifically pywikibot.Page().get(). I want all the Wiki Markup as well. The get() method gives this to me but only for the page at the current time. Is there a way to get the article text once a specified revision has occurred?


Solution

  • If you have both page name and revid associated :

    text = pywikibot.Page(pywikibot.Site(), 'WP:Accueil_principal').getOldVersion(oldid=141963852)