From c8b55252f52f614e9b6faf5fb707773c48dc0617 Mon Sep 17 00:00:00 2001 From: unkn0w7n <51942695+unkn0w7n@users.noreply.github.com> Date: Fri, 10 Jan 2025 08:26:07 +0530 Subject: [PATCH] Update business_standard_print.recipe --- recipes/business_standard_print.recipe | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/recipes/business_standard_print.recipe b/recipes/business_standard_print.recipe index c2d1afbbf5..f4dc6d6de1 100644 --- a/recipes/business_standard_print.recipe +++ b/recipes/business_standard_print.recipe @@ -131,13 +131,16 @@ class BusinessStandardPrint(BasicNewsRecipe): if 'alt_text' in data['featuredImageObj']: caption = '' + data['featuredImageObj']['alt_text'] + '

' - body = data['htmlContent'].replace('
\r\n\t\t ', '
') + body = data['htmlContent'] return '' + cat + title + subhead + auth + lede + caption + '

' + body + '
' def preprocess_html(self, soup): for img in soup.findAll('img'): img.attrs = {'src': img.get('src', '')} - for x in soup.findAll('div'): + for x in soup.findAll('div', 'p'): x.attrs = {'class': x.get('class', '')} + for attr in self.remove_attributes: + for x in soup.findAll(attrs={attr: True}): + del x[attr] return soup