mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #1817828 [Economist Magazine download not working](https://bugs.launchpad.net/calibre/+bug/1817828)
This commit is contained in:
parent
7fd2cb4893
commit
494140ecc1
@ -167,12 +167,12 @@ class Economist(BasicNewsRecipe):
|
|||||||
# with open('/t/raw.html', 'wb') as f:
|
# with open('/t/raw.html', 'wb') as f:
|
||||||
# f.write(raw)
|
# f.write(raw)
|
||||||
soup = self.index_to_soup(raw)
|
soup = self.index_to_soup(raw)
|
||||||
nav = soup.find(attrs={'class':'navigation__wrapper'})
|
# nav = soup.find(attrs={'class':'navigation__wrapper'})
|
||||||
if nav is not None:
|
# if nav is not None:
|
||||||
a = nav.find('a', href=lambda x: x and '/printedition/' in x)
|
# a = nav.find('a', href=lambda x: x and '/printedition/' in x)
|
||||||
if a is not None:
|
# if a is not None:
|
||||||
self.log('Following nav link to current edition', a['href'])
|
# self.log('Following nav link to current edition', a['href'])
|
||||||
soup = self.index_to_soup(process_url(a['href']))
|
# soup = self.index_to_soup(process_url(a['href']))
|
||||||
ans = self.economist_parse_index(soup)
|
ans = self.economist_parse_index(soup)
|
||||||
if not ans:
|
if not ans:
|
||||||
raise NoArticles(
|
raise NoArticles(
|
||||||
|
@ -167,12 +167,12 @@ class Economist(BasicNewsRecipe):
|
|||||||
# with open('/t/raw.html', 'wb') as f:
|
# with open('/t/raw.html', 'wb') as f:
|
||||||
# f.write(raw)
|
# f.write(raw)
|
||||||
soup = self.index_to_soup(raw)
|
soup = self.index_to_soup(raw)
|
||||||
nav = soup.find(attrs={'class':'navigation__wrapper'})
|
# nav = soup.find(attrs={'class':'navigation__wrapper'})
|
||||||
if nav is not None:
|
# if nav is not None:
|
||||||
a = nav.find('a', href=lambda x: x and '/printedition/' in x)
|
# a = nav.find('a', href=lambda x: x and '/printedition/' in x)
|
||||||
if a is not None:
|
# if a is not None:
|
||||||
self.log('Following nav link to current edition', a['href'])
|
# self.log('Following nav link to current edition', a['href'])
|
||||||
soup = self.index_to_soup(process_url(a['href']))
|
# soup = self.index_to_soup(process_url(a['href']))
|
||||||
ans = self.economist_parse_index(soup)
|
ans = self.economist_parse_index(soup)
|
||||||
if not ans:
|
if not ans:
|
||||||
raise NoArticles(
|
raise NoArticles(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user