From 6331c073f75b8e2c6beabaccdce3348b0345d6e4 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 5 Jan 2013 23:23:04 +0530 Subject: [PATCH] Update New York Review of Books --- recipes/new_york_review_of_books.recipe | 29 +++++++++++++------------ 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/recipes/new_york_review_of_books.recipe b/recipes/new_york_review_of_books.recipe index bd18b95c43..bff7421b43 100644 --- a/recipes/new_york_review_of_books.recipe +++ b/recipes/new_york_review_of_books.recipe @@ -66,21 +66,22 @@ class NewYorkReviewOfBooks(BasicNewsRecipe): self.log('Issue date:', date) # Find TOC - toc = soup.find('ul', attrs={'class':'issue-article-list'}) + tocs = soup.findAll('ul', attrs={'class':'issue-article-list'}) articles = [] - for li in toc.findAll('li'): - h3 = li.find('h3') - title = self.tag_to_string(h3) - author = self.tag_to_string(li.find('h4')) - title = title + u' (%s)'%author - url = 'http://www.nybooks.com'+h3.find('a', href=True)['href'] - desc = '' - for p in li.findAll('p'): - desc += self.tag_to_string(p) - self.log('Found article:', title) - self.log('\t', url) - self.log('\t', desc) - articles.append({'title':title, 'url':url, 'date':'', + for toc in tocs: + for li in toc.findAll('li'): + h3 = li.find('h3') + title = self.tag_to_string(h3) + author = self.tag_to_string(li.find('h4')) + title = title + u' (%s)'%author + url = 'http://www.nybooks.com'+h3.find('a', href=True)['href'] + desc = '' + for p in li.findAll('p'): + desc += self.tag_to_string(p) + self.log('Found article:', title) + self.log('\t', url) + self.log('\t', desc) + articles.append({'title':title, 'url':url, 'date':'', 'description':desc}) return [('Current Issue', articles)]