fetch the economist cover from archive page

This commit is contained in:
xxyzz 2020-09-04 11:56:51 +00:00 committed by GitHub
parent ce0cdf11c0
commit 0f148073fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -249,7 +249,8 @@ class Economist(BasicNewsRecipe):
return ans
def economist_parse_index(self, soup):
div = soup.find(attrs={'class': 'weekly-edition-header__image'})
archive = self.index_to_soup("https://www.economist.com/weeklyedition/archive")
div = archive.find(attrs={'class': 'edition-teaser__image'})
if div is not None:
img = div.find('img', srcset=True)
self.cover_url = img['srcset'].split(',')[-1].split()[0]