Update financial_times.recipe

This commit is contained in:
unkn0w7n 2024-04-26 10:47:11 +05:30
parent d1bbe63eb1
commit 0a7be539f1

View File

@ -146,6 +146,10 @@ class ft(BasicNewsRecipe):
return html return html
def preprocess_html(self, soup): def preprocess_html(self, soup):
for table in soup.findAll('table'):
if len(table.find('tbody').findAll('tr')) > 20:
table.find('tbody').decompose()
table.string = '** a table that was supposed to be here has been removed.'
for con in soup.findAll(attrs={'class':'n-content-layout__slot'}): for con in soup.findAll(attrs={'class':'n-content-layout__slot'}):
if con.find('figure'): if con.find('figure'):
con['id'] = 'fig' con['id'] = 'fig'