mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Dont rely on select_one() since it is not present in older calibre
This commit is contained in:
parent
bdfb061ac9
commit
b3ba942ce6
@ -264,7 +264,7 @@ class Economist(BasicNewsRecipe):
|
|||||||
return ans
|
return ans
|
||||||
|
|
||||||
def economist_parse_index(self, soup):
|
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:
|
if script_tag is not None:
|
||||||
data = json.loads(script_tag.string)
|
data = json.loads(script_tag.string)
|
||||||
self.cover_url = data['props']['pageProps']['content']['image']['main']['url']['canonical']
|
self.cover_url = data['props']['pageProps']['content']['image']['main']['url']['canonical']
|
||||||
|
@ -264,7 +264,7 @@ class Economist(BasicNewsRecipe):
|
|||||||
return ans
|
return ans
|
||||||
|
|
||||||
def economist_parse_index(self, soup):
|
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:
|
if script_tag is not None:
|
||||||
data = json.loads(script_tag.string)
|
data = json.loads(script_tag.string)
|
||||||
self.cover_url = data['props']['pageProps']['content']['image']['main']['url']['canonical']
|
self.cover_url = data['props']['pageProps']['content']['image']['main']['url']['canonical']
|
||||||
|
Loading…
x
Reference in New Issue
Block a user