Skip to content

Commit

Permalink
Update business_standard_print.recipe
Browse files Browse the repository at this point in the history
  • Loading branch information
unkn0w7n committed Jan 10, 2025
1 parent dd6b924 commit c8b5525
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions recipes/business_standard_print.recipe
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,16 @@ class BusinessStandardPrint(BasicNewsRecipe):
if 'alt_text' in data['featuredImageObj']:
caption = '<span>' + data['featuredImageObj']['alt_text'] + '</span></p>'

body = data['htmlContent'].replace('<br />\r\n\t\t&nbsp;', '<br>')
body = data['htmlContent']

return '<html><body>' + cat + title + subhead + auth + lede + caption + '<div><br>' + body + '</div></body></html>'

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

0 comments on commit c8b5525

Please sign in to comment.