Update New York Review of Books

This commit is contained in:
Kovid Goyal 2025-09-05 20:07:03 +05:30
parent 0f3a1d6ff3
commit 7d9a2aee8a
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 10 additions and 4 deletions

View File

@ -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 = ''

View File

@ -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 = ''