Update New York Review of Books

This commit is contained in:
Kovid Goyal 2013-01-05 23:23:04 +05:30
parent 81af3cd695
commit 6331c073f7

View File

@ -66,21 +66,22 @@ class NewYorkReviewOfBooks(BasicNewsRecipe):
self.log('Issue date:', date) self.log('Issue date:', date)
# Find TOC # Find TOC
toc = soup.find('ul', attrs={'class':'issue-article-list'}) tocs = soup.findAll('ul', attrs={'class':'issue-article-list'})
articles = [] articles = []
for li in toc.findAll('li'): for toc in tocs:
h3 = li.find('h3') for li in toc.findAll('li'):
title = self.tag_to_string(h3) h3 = li.find('h3')
author = self.tag_to_string(li.find('h4')) title = self.tag_to_string(h3)
title = title + u' (%s)'%author author = self.tag_to_string(li.find('h4'))
url = 'http://www.nybooks.com'+h3.find('a', href=True)['href'] title = title + u' (%s)'%author
desc = '' url = 'http://www.nybooks.com'+h3.find('a', href=True)['href']
for p in li.findAll('p'): desc = ''
desc += self.tag_to_string(p) for p in li.findAll('p'):
self.log('Found article:', title) desc += self.tag_to_string(p)
self.log('\t', url) self.log('Found article:', title)
self.log('\t', desc) self.log('\t', url)
articles.append({'title':title, 'url':url, 'date':'', self.log('\t', desc)
articles.append({'title':title, 'url':url, 'date':'',
'description':desc}) 'description':desc})
return [('Current Issue', articles)] return [('Current Issue', articles)]