diff --git a/recipes/economist.recipe b/recipes/economist.recipe index 90901c1b28..e5f7628be9 100644 --- a/recipes/economist.recipe +++ b/recipes/economist.recipe @@ -264,8 +264,9 @@ class Economist(BasicNewsRecipe): return ans def economist_parse_index(self, soup): - if (tag := soup.select_one("script#__NEXT_DATA__")) is not None: - data = json.loads(tag.string) + script_tag = soup.select_one("script#__NEXT_DATA__") + if script_tag is not None: + data = json.loads(script_tag.string) self.cover_url = data['props']['pageProps']['content']['image']['main']['url']['canonical'] self.log('Got cover:', self.cover_url) feeds = [] diff --git a/recipes/economist_free.recipe b/recipes/economist_free.recipe index 90901c1b28..e5f7628be9 100644 --- a/recipes/economist_free.recipe +++ b/recipes/economist_free.recipe @@ -264,8 +264,9 @@ class Economist(BasicNewsRecipe): return ans def economist_parse_index(self, soup): - if (tag := soup.select_one("script#__NEXT_DATA__")) is not None: - data = json.loads(tag.string) + script_tag = soup.select_one("script#__NEXT_DATA__") + if script_tag is not None: + data = json.loads(script_tag.string) self.cover_url = data['props']['pageProps']['content']['image']['main']['url']['canonical'] self.log('Got cover:', self.cover_url) feeds = []