mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Another nytimes parse todays page fix
Fix all articles after front page being put into the internal section
This commit is contained in:
parent
b2ab2bfd6a
commit
53e1398ed6
@ -111,10 +111,12 @@ class NewYorkTimes(BasicNewsRecipe):
|
||||
continue
|
||||
section_title = self.tag_to_string(h1)
|
||||
self.log('Found section:', section_title)
|
||||
container = h1.parent
|
||||
articles = list(self.parse_todays_sections(container))
|
||||
if i == 1:
|
||||
container = h1.parent
|
||||
articles = list(self.parse_todays_sections(container))
|
||||
articles += list(self.parse_todays_sections(container.findNextSibling('div')))
|
||||
else:
|
||||
articles = list(self.parse_todays_sections(h1.findNextSibling('ol')))
|
||||
if articles:
|
||||
feeds.append((section_title, articles))
|
||||
return feeds
|
||||
|
@ -111,10 +111,12 @@ class NewYorkTimes(BasicNewsRecipe):
|
||||
continue
|
||||
section_title = self.tag_to_string(h1)
|
||||
self.log('Found section:', section_title)
|
||||
container = h1.parent
|
||||
articles = list(self.parse_todays_sections(container))
|
||||
if i == 1:
|
||||
container = h1.parent
|
||||
articles = list(self.parse_todays_sections(container))
|
||||
articles += list(self.parse_todays_sections(container.findNextSibling('div')))
|
||||
else:
|
||||
articles = list(self.parse_todays_sections(h1.findNextSibling('ol')))
|
||||
if articles:
|
||||
feeds.append((section_title, articles))
|
||||
return feeds
|
||||
|
Loading…
x
Reference in New Issue
Block a user