Handle change to newsweek index page

This commit is contained in:
Kovid Goyal 2018-12-05 10:02:39 +05:30
parent 65eafd1f7c
commit d00558765d
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -75,7 +75,10 @@ class Newsweek(BasicNewsRecipe):
sections = defaultdict(list)
for block in ('magazine-magazine-issue-story-list', 'editors-pick'):
div = root.xpath(
'//div[@id="block-nw-{}"]'.format(block))[0]
'//div[@id="block-nw-{}"]'.format(block))
if not div:
continue
div = div[0]
for a in div.xpath(href_xpath):
title = self.tag_to_string(a)
article = a.xpath('ancestor::article')[0]