Update Newsweek

This commit is contained in:
Kovid Goyal 2017-09-01 14:15:47 +05:30
parent 6f9214d5a7
commit af6b232bf6
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -31,7 +31,7 @@ class Newsweek(BasicNewsRecipe):
'block-openadstream', 'block-ibtmedia-social', 'issue-next', 'block-openadstream', 'block-ibtmedia-social', 'issue-next',
'most-popular', 'ibt-media-stories', 'user-btn-group', 'most-popular', 'ibt-media-stories', 'user-btn-group',
'trial-link', 'trc_related_container', 'trial-link', 'trc_related_container',
'block-ibtmedia-top-stories' 'block-ibtmedia-top-stories', 'videocontent', 'newsletter-signup',
), ),
dict(id=['taboola-below-main-column', 'piano-root', dict(id=['taboola-below-main-column', 'piano-root',
'block-nw-magazine-magazine-more-from-issue']), 'block-nw-magazine-magazine-more-from-issue']),
@ -58,12 +58,12 @@ class Newsweek(BasicNewsRecipe):
'//div[@id="block-nw-magazine-magazine-issue-story-list"]')[0] '//div[@id="block-nw-magazine-magazine-issue-story-list"]')[0]
for a in div.xpath('descendant::h3/a[@href and contains(@class, "article-link")]'): for a in div.xpath('descendant::h3/a[@href and contains(@class, "article-link")]'):
title = self.tag_to_string(a) title = self.tag_to_string(a)
li = a.xpath('ancestor::li')[0] article = a.xpath('ancestor::article')[0]
desc = '' desc = ''
s = li.xpath('descendant::div[@class="summary"]') s = article.xpath('descendant::div[@class="summary"]')
if s: if s:
desc = self.tag_to_string(s[0]) desc = self.tag_to_string(s[0])
sec = li.xpath('descendant::div[@class="category"]') sec = article.xpath('descendant::div[@class="category"]')
if sec: if sec:
sec = self.tag_to_string(sec[0]) sec = self.tag_to_string(sec[0])
else: else: