Update New York Times Book Review

This commit is contained in:
Kovid Goyal 2018-06-03 23:31:30 +05:30
parent 7834ef238b
commit 2c83c4747e
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -18,13 +18,25 @@ class NewYorkTimesBookReview(BasicNewsRecipe):
encoding = 'utf-8' encoding = 'utf-8'
keep_only_tags = [ keep_only_tags = [
dict(itemprop=['headline', 'author', 'associatedMedia', 'articleBody', 'reviewBody']), dict(id='story'),
classes('story-body StoryBodyCompanionColumn'),
] ]
remove_tags = [ remove_tags = [
dict(id=['d-promo-realestate', 'books-update-email-promo']), dict(attrs={'aria-label':'tools'.split()}),
dict(style=lambda x: x and 'visibility: hidden' in x), dict(attrs={'aria-label': lambda x: x and 'New York Times Logo' in x}),
classes('skip-to-text-link story-meta-footer-sharetools story-footer-links'), dict(href='#site-content #site-index'.split()),
dict(attrs={'aria-hidden':'true'}),
dict(attrs={'data-videoid':True}),
dict(name='button meta link'.split()),
dict(id=lambda x: x and x.startswith('story-ad-')),
dict(name='head'),
dict(role='toolbar'),
dict(name='a', href=lambda x: x and '#story-continues-' in x),
dict(name='a', href=lambda x: x and '#whats-next' in x),
dict(id=lambda x: x and 'sharetools-' in x),
dict(id='newsletter-promo supported-by-ad bottom-wrapper'.split()),
classes('story-print-citation supported-by accessibility-ad-header visually-hidden bottom-of-article ad nav-wrapper'),
dict(attrs={'class': lambda x: x and (
'SectionBar' in x or 'recirculation' in x or 'ResponsiveAd' in x or 'accessibility-visuallyHidden' in x or 'RelatedCoverage' in x)}),
] ]
def parse_index(self): def parse_index(self):