mwclient accessing page history for dynamic pages

Jump to: navigation, search

hello bryan i am trying to use mwclient to download full article history for some pages but i can't get mwclient to get the page_title dynamically site = mwclient.site('en.wikipedia.org') page = page.site['string') // i am trying to get something equivalent to page.site('%s') % (variable) or page.site(variable) i am also unsure about how to download the full history, for i am only able to retrieve the revisions using page.revisions() is that possible? Wikipositivist 20:43, 29 June 2011 (UTC)

Wikipositivist20:43, 29 June 2011

page.site[variable] ?

-- Bryan (talk|commons)20:47, 29 June 2011
 

since i have a list of pages to look up (which i obtained from a query), i was actually hoping to get the following working str = cursor.fetchall(query) page = site.Pages[str]

173.32.166.18800:39, 30 June 2011

correction to above: cursor.fetchall(query) for p in str: site.pages[p]

173.32.166.18800:43, 30 June 2011

The return value of cursor.fetchall() is a tuple, so you should use p[0].

145.94.184.11807:35, 30 June 2011
Edited by author.
Last edit: 04:32, 11 July 2011
173.32.166.18820:17, 30 June 2011
Edited by 2 users.
Last edit: 09:07, 13 July 2011

in other words, I wanted to know if it is possible to obtain the equivalent of a special export of the text and history of page. page.revisions() gives me the history & I was needing to get the text as well

Also I was wondering if anyone could help me find a way to obtain the 'currentstatus' of articles (currenstatus could be FA, GA, GAN etc.), the currentstatus info seems to be accessible only through the text table

SwJ15:51, 6 July 2011

Not really. You could look at the categories.

-- Bryan (talk|commons)09:07, 13 July 2011