This commit is contained in:
unkn0w7n 2024-05-02 12:54:10 +05:30
parent 39525aeafc
commit 293a538423
2 changed files with 5 additions and 0 deletions

View File

@ -146,6 +146,9 @@ class ft(BasicNewsRecipe):
return html
def preprocess_html(self, soup):
p = soup.find(**classes('o-topper__standfirst'))
if p:
p.name = 'p'
for table in soup.findAll('table'):
if len(table.find('tbody').findAll('tr')) > 20:
table.find('tbody').decompose()

View File

@ -76,7 +76,9 @@ class MitTechnologyReview(BasicNewsRecipe):
soup = self.index_to_soup(self.INDEX)
issue = soup.find(attrs={'class':lambda x: x and x.startswith('magazineHero__title')})
time = soup.find(attrs={'class': lambda x: x and x.startswith('magazineHero__date')})
desc = soup.find(attrs={'class': lambda x: x and x.startswith('magazineHero__description')})
self.title = 'MIT Tech Review ' + self.tag_to_string(issue)
self.description = self.tag_to_string(desc)
self.timefmt = ' [' + self.tag_to_string(time) + ']'
self.log('Downloading issue: ', self.timefmt)