mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #1817460 [harpers print magazine recipe broken](https://bugs.launchpad.net/calibre/+bug/1817460)
This commit is contained in:
parent
c81ffa6d1a
commit
3137572207
@ -4,7 +4,7 @@
|
|||||||
# kate: encoding utf-8; syntax python;
|
# kate: encoding utf-8; syntax python;
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2008-2017, Darko Miletic <darko.miletic at gmail.com>'
|
__copyright__ = '2008-2019, Darko Miletic <darko.miletic at gmail.com>'
|
||||||
'''
|
'''
|
||||||
harpers.org - paid subscription/ printed issue articles
|
harpers.org - paid subscription/ printed issue articles
|
||||||
This recipe only get's article's published in text format
|
This recipe only get's article's published in text format
|
||||||
@ -69,15 +69,14 @@ class Harpers_full(BasicNewsRecipe):
|
|||||||
def parse_index(self):
|
def parse_index(self):
|
||||||
# find current issue
|
# find current issue
|
||||||
soup = self.index_to_soup('https://harpers.org/')
|
soup = self.index_to_soup('https://harpers.org/')
|
||||||
currentIssue = soup.find('div', attrs={'class': 'mainNavi'}).find(
|
currentIssue = soup.find('a', attrs={'id':'header-menu-dropdown-1'})
|
||||||
'li', attrs={'class': 'curentIssue'})
|
currentIssue_url = self.tag_to_string(currentIssue['href'])
|
||||||
currentIssue_url = self.tag_to_string(currentIssue.a['href'])
|
|
||||||
self.log(currentIssue_url)
|
self.log(currentIssue_url)
|
||||||
|
|
||||||
# go to the current issue
|
# go to the current issue
|
||||||
soup1 = self.index_to_soup(currentIssue_url)
|
soup1 = self.index_to_soup(currentIssue_url)
|
||||||
currentIssue_title = self.tag_to_string(soup1.head.title.string)
|
currentIssue_title = self.tag_to_string(soup1.head.title.string)
|
||||||
date = re.split('\s\|\s', currentIssue_title)[0]
|
date = re.split(r'\s\|\s', currentIssue_title)[0]
|
||||||
self.timefmt = u' [%s]' % date
|
self.timefmt = u' [%s]' % date
|
||||||
|
|
||||||
# get cover
|
# get cover
|
||||||
|
Loading…
x
Reference in New Issue
Block a user