I get this:
Code:
1% Trying to download cover...
At this point in the code the value of variable cov is: <img alt="" src="http://media.abc.com/images/2012/01/30/cover0212_227033.jpg" />
At this point in the code the value of variable self.cover_url is: http://media.abc.com/images/2012/01/30/cover0212_227033.jpg
which is a good image.
So is there something I'm missing as to how to actually assign the image as the cover? Is there some obvious thing I've left out of the end of the recipe?
Again, the whole recipe I have so far is: (with feeds list truncated to save space)
Code:
class AdvancedUserRecipe1330393641(BasicNewsRecipe):
title = u'abc'
oldest_article = 30
max_articles_per_feed = 100
auto_cleanup = True
def get_cover_url(self):
cover_url = None
soup = self.index_to_soup('http://www.abc.com')
cov = soup.find('img', src=re.compile(r'\w*?cover\w{1,22}\.jpg'))
if cov is not None:
self.cover_url = cov['src']
print 'At this point in the code the value of variable cov is: ', cov
print 'At this point in the code the value of variable self.cover_url is: ', self.cover_url
feeds = [(...)]
def print_version(self, url):
return url.replace('/article/', '/printarticle/')