diff --git a/recipes/new_york_review_of_books.recipe b/recipes/new_york_review_of_books.recipe index d2eff8d35c..6ea1fde549 100644 --- a/recipes/new_york_review_of_books.recipe +++ b/recipes/new_york_review_of_books.recipe @@ -74,9 +74,12 @@ class NewYorkReviewOfBooks(BasicNewsRecipe): # Find TOC articles = [] - for h4 in soup.findAll('h4'): + for h4 in soup.findAll('h2'): title = self.tag_to_string(h4).strip() - url = absurl(h4.find('a')['href']) + a = h4.find('a') + if a is None: + continue + url = absurl(a['href']) author = self.tag_to_string(h4.parent.parent.find('a')) title = title + ' (%s)' % author desc = '' diff --git a/recipes/new_york_review_of_books_no_sub.recipe b/recipes/new_york_review_of_books_no_sub.recipe index e36cd9978a..dad9785f3d 100644 --- a/recipes/new_york_review_of_books_no_sub.recipe +++ b/recipes/new_york_review_of_books_no_sub.recipe @@ -64,9 +64,12 @@ class NewYorkReviewOfBooks(BasicNewsRecipe): # Find TOC articles = [] - for h4 in soup.findAll('h4'): + for h4 in soup.findAll('h2'): title = self.tag_to_string(h4).strip() - url = absurl(h4.find('a')['href']) + a = h4.find('a') + if a is None: + continue + url = absurl(a['href']) author = self.tag_to_string(h4.parent.parent.find('a')) title = title + ' (%s)' % author desc = ''