mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Update The New Yorker
This commit is contained in:
parent
5779af5140
commit
db54fbeca0
@ -41,13 +41,15 @@ class NewYorker(BasicNewsRecipe):
|
|||||||
articles = []
|
articles = []
|
||||||
current_section = 'Current Issue'
|
current_section = 'Current Issue'
|
||||||
feeds = []
|
feeds = []
|
||||||
for story in soup.findAll(['h5', 'article'], itemtype=[None, 'http://schema.org/NewsArticle']):
|
for story in soup.findAll(['h5', 'article']):
|
||||||
if story.name == 'h5':
|
if story.name == 'h5':
|
||||||
if articles:
|
if articles:
|
||||||
feeds.append((current_section, articles))
|
feeds.append((current_section, articles))
|
||||||
current_section, articles = self.tag_to_string(story), []
|
current_section, articles = self.tag_to_string(story), []
|
||||||
self.log('\nFound section: ' + current_section)
|
self.log('\nFound section: ' + current_section)
|
||||||
continue
|
continue
|
||||||
|
if story['itemtype'] != 'http://schema.org/Article':
|
||||||
|
continue
|
||||||
h2 = story.find('h2')
|
h2 = story.find('h2')
|
||||||
url = h2.find('a', href=True)['href']
|
url = h2.find('a', href=True)['href']
|
||||||
a = h2.find('a')
|
a = h2.find('a')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user