tags:

views:

42

answers:

3

Hey guys, Currently having some problems-

now = datetime.datetime.now()
month = now.strftime("%B")


site = wikipedia.getSite('en', 'wikiquote')
page = wikipedia.Page(site, u"Wikiquote:Quote_of_the_day:abc")

I need to get abc to change into the name of the month before it then tries to get the page, yet everything I try it gives an error of some sort.

How could I do it?

Thanks!

+1  A: 

Would this work?

page = wikipedia.Page(site, u"Wikiquote:Quote_of_the_day:" + month)
Brandon Craig Rhodes
Oh how easy it was! Thank you!
Solihull
A: 

Did you try this:

page = wikipedia.Page(site, u"Wikiquote:Quote_of_the_day:%s" % month )
Shane C. Mason
+2  A: 

The page URL format is actually Wikiquote:Quote_of_the_day/Month. Try this:

page = wikipedia.Page(site, u"Wikiquote:Quote_of_the_day/%s" % month)
Nadia Alramli