diff --git a/recipes/ars_technica.recipe b/recipes/ars_technica.recipe index e3cdc03052..1b4d04ccd1 100644 --- a/recipes/ars_technica.recipe +++ b/recipes/ars_technica.recipe @@ -77,13 +77,15 @@ class ArsTechnica(BasicNewsRecipe): texttag = soup2.find(attrs={'class': 'article-guts'}) if texttag is not None: newpos = len(texttag.contents) - self.append_page(soup2, texttag, newpos) + soup = self.append_page(soup2, texttag, newpos) texttag.extract() pager.extract() appendtag.insert(position, texttag) + soup = BeautifulSoup(soup.renderContents().decode('utf-8')) + return soup def preprocess_html(self, soup): - self.append_page(soup, soup.body, 3) + soup = self.append_page(soup, soup.body, 3) for item in soup.findAll('a'): limg = item.find('img') if item.string is not None: @@ -92,7 +94,7 @@ class ArsTechnica(BasicNewsRecipe): else: if limg: item.name = 'div' - item.attrs = [] + item.attrs.clear() else: str = self.tag_to_string(item) item.replaceWith(str)