From 3b4d2ef2739a4a559b748601dd9e9ffdbfa810e7 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 8 Apr 2024 11:20:35 +0530 Subject: [PATCH] pep8 --- recipes/new_yorker.recipe | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/recipes/new_yorker.recipe b/recipes/new_yorker.recipe index 0423f57e2d..3dca0ccb0d 100644 --- a/recipes/new_yorker.recipe +++ b/recipes/new_yorker.recipe @@ -6,7 +6,6 @@ from __future__ import absolute_import, division, print_function, unicode_litera from collections import defaultdict from calibre import browser -from calibre.ebooks.BeautifulSoup import Tag from calibre.web.feeds.news import BasicNewsRecipe, classes, prefixed_classes @@ -114,12 +113,11 @@ class NewYorker(BasicNewsRecipe): soup = self.index_to_soup( 'https://www.newyorker.com/magazine?intcid=magazine') feeds_dict = defaultdict(list) - for section in soup.findAll('section', + for section in soup.findAll('section', attrs={'class': lambda x: x and 'SummaryRiverSection-' in x}): for h2 in section.findAll(attrs={'class':lambda x: x and 'SectionTitleHed-' in x}): secname = self.tag_to_string(h2) self.log(secname) - articles = [] for a in section.findAll('a', href=True, attrs={'class':lambda x: x and 'summary-item__hed-link' in x}): section = secname url = absurl(a['href'])