From b3ba942ce628e33422e0e8eb53830aa080aeb15c Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 27 Mar 2021 16:13:56 +0530 Subject: [PATCH] Dont rely on select_one() since it is not present in older calibre --- recipes/economist.recipe | 2 +- recipes/economist_free.recipe | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/economist.recipe b/recipes/economist.recipe index e5f7628be9..d89a446b11 100644 --- a/recipes/economist.recipe +++ b/recipes/economist.recipe @@ -264,7 +264,7 @@ class Economist(BasicNewsRecipe): return ans def economist_parse_index(self, soup): - script_tag = soup.select_one("script#__NEXT_DATA__") + script_tag = soup.find("script", id="__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'] diff --git a/recipes/economist_free.recipe b/recipes/economist_free.recipe index e5f7628be9..d89a446b11 100644 --- a/recipes/economist_free.recipe +++ b/recipes/economist_free.recipe @@ -264,7 +264,7 @@ class Economist(BasicNewsRecipe): return ans def economist_parse_index(self, soup): - script_tag = soup.select_one("script#__NEXT_DATA__") + script_tag = soup.find("script", id="__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']