Quote:
Originally Posted by weebl
I am working on a recipe for the Poughkeepsie Journal and I would like to replace a masthead. I am a new at this and the method I tried is not working.
|
This is a recipe question and really ought to be in the
recipe subforum, but ....
Quote:
I've tried the following:
Code:
def print_version(self, url):
return url.replace('http://www.poughkeepsiejournal.com', 'http://www.poughkeepsiejournal.com/print')
return url.replace('http://www.poughkeepsiejournal.com/graphics/mastlogo.gif','http://www.poughkeepsiejournal.com/graphics/branding.gif')
The portion that is not working is replacing the mastlogo.gif with the branding.gif.
Thanks for any help
|
You can't have two returns above. Delete the one that reads:
Code:
return url.replace('http://www.poughkeepsiejournal.com/graphics/mastlogo.gif','http://www.poughkeepsiejournal.com/graphics/branding.gif')
Add your masthead to the main code (outside print_version) as follows:
Code:
masthead_url = 'http://www.poughkeepsiejournal.com/graphics/branding.gif'