mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-20 19:26:06 +01:00
Update The New Yorker
This commit is contained in:
parent
5779af5140
commit
db54fbeca0
1 changed files with 3 additions and 1 deletions
|
|
@ -41,13 +41,15 @@ def parse_index(self):
|
|||
articles = []
|
||||
current_section = 'Current Issue'
|
||||
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 articles:
|
||||
feeds.append((current_section, articles))
|
||||
current_section, articles = self.tag_to_string(story), []
|
||||
self.log('\nFound section: ' + current_section)
|
||||
continue
|
||||
if story['itemtype'] != 'http://schema.org/Article':
|
||||
continue
|
||||
h2 = story.find('h2')
|
||||
url = h2.find('a', href=True)['href']
|
||||
a = h2.find('a')
|
||||
|
|
|
|||
Loading…
Reference in a new issue