Update scientific_american.recipe

remove p tags in captions
This commit is contained in:
unkn0w7n 2023-12-06 12:16:02 +05:30
parent 16b64d1932
commit c33d89f0c5

View File

@ -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: