mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Update Ars Technica
This commit is contained in:
parent
c12c80e174
commit
be27f464b2
@ -77,13 +77,15 @@ class ArsTechnica(BasicNewsRecipe):
|
|||||||
texttag = soup2.find(attrs={'class': 'article-guts'})
|
texttag = soup2.find(attrs={'class': 'article-guts'})
|
||||||
if texttag is not None:
|
if texttag is not None:
|
||||||
newpos = len(texttag.contents)
|
newpos = len(texttag.contents)
|
||||||
self.append_page(soup2, texttag, newpos)
|
soup = self.append_page(soup2, texttag, newpos)
|
||||||
texttag.extract()
|
texttag.extract()
|
||||||
pager.extract()
|
pager.extract()
|
||||||
appendtag.insert(position, texttag)
|
appendtag.insert(position, texttag)
|
||||||
|
soup = BeautifulSoup(soup.renderContents().decode('utf-8'))
|
||||||
|
return soup
|
||||||
|
|
||||||
def preprocess_html(self, 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'):
|
for item in soup.findAll('a'):
|
||||||
limg = item.find('img')
|
limg = item.find('img')
|
||||||
if item.string is not None:
|
if item.string is not None:
|
||||||
@ -92,7 +94,7 @@ class ArsTechnica(BasicNewsRecipe):
|
|||||||
else:
|
else:
|
||||||
if limg:
|
if limg:
|
||||||
item.name = 'div'
|
item.name = 'div'
|
||||||
item.attrs = []
|
item.attrs.clear()
|
||||||
else:
|
else:
|
||||||
str = self.tag_to_string(item)
|
str = self.tag_to_string(item)
|
||||||
item.replaceWith(str)
|
item.replaceWith(str)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user