From aa8f685184fe7e2d5a384df1c3c0bc76efc7fcb2 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 8 Nov 2017 08:05:54 +0530 Subject: [PATCH] Fix #1730707 [Impossible to retrieve News from The Newyorker](https://bugs.launchpad.net/calibre/+bug/1730707) --- recipes/new_yorker.recipe | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/recipes/new_yorker.recipe b/recipes/new_yorker.recipe index a6c7144be6..0236b60b25 100644 --- a/recipes/new_yorker.recipe +++ b/recipes/new_yorker.recipe @@ -56,6 +56,7 @@ class NewYorker(BasicNewsRecipe): remove_tags = [ classes('content-ad-wrapper social-hover background-image'), dict(id=['newsletter-signup']), + dict(attrs={'class': lambda x: x and 'ImageEmbed__button___' in x}), dict(name='links source'.split()), ] remove_attributes = ['style'] @@ -80,8 +81,9 @@ class NewYorker(BasicNewsRecipe): except KeyError: section = last_section last_section = section - a = story.find('h4').find('a') - title = a.contents[1] + h4 = story.find('h4') + title = self.tag_to_string(h4) + a = story.find('h4').parent url = absurl(a['href']) desc = '' body = story.find(attrs={'class': 'River__dek___CayIg'})