Retrieve the latest magazine cover's thumbnail to use as the cover

This commit is contained in:
Andrew Flegg 2016-12-11 11:28:20 -08:00
parent 1ec001d53d
commit 79a88546f0

View File

@ -107,3 +107,12 @@ class WiredDailyNews(BasicNewsRecipe):
magazine_year_month = self.get_magazine_year_month('.')
return [('Magazine-' + magazine_year_month, articles)]
def get_cover_url(self):
'''
get the most recent magazine cover
:return: url
'''
soup = self.index_to_soup('https://www.wired.com/category/magazine/')
return soup.find(id='mag-card').find('img').get('src')