From c33d89f0c5e8f81aac5667c9e727551ae64940a9 Mon Sep 17 00:00:00 2001 From: unkn0w7n <51942695+unkn0w7n@users.noreply.github.com> Date: Wed, 6 Dec 2023 12:16:02 +0530 Subject: [PATCH] Update scientific_american.recipe remove p tags in captions --- recipes/scientific_american.recipe | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/recipes/scientific_american.recipe b/recipes/scientific_american.recipe index 3bf5959d39..345c1fefba 100644 --- a/recipes/scientific_american.recipe +++ b/recipes/scientific_american.recipe @@ -44,6 +44,12 @@ class ScientificAmerican(BasicNewsRecipe): dict(name=['button', 'svg', 'iframe', 'source']) ] + def preprocess_html(self, soup): + for fig in soup.findAll('figcaption'): + for p in fig.findAll('p'): + p.name = 'span' + return soup + def get_browser(self, *args): br = BasicNewsRecipe.get_browser(self) if self.username and self.password: