From 0f148073fdd898743a270f33b9c4005806f18fc5 Mon Sep 17 00:00:00 2001 From: xxyzz Date: Fri, 4 Sep 2020 11:56:51 +0000 Subject: [PATCH] fetch the economist cover from archive page --- recipes/economist.recipe | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recipes/economist.recipe b/recipes/economist.recipe index 8b68630738..6d088bc51b 100644 --- a/recipes/economist.recipe +++ b/recipes/economist.recipe @@ -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]