mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Merge branch 'master' of https://github.com/unkn0w7n/calibre
This commit is contained in:
commit
0fc78f89e0
@ -66,6 +66,9 @@ class LiveMint(BasicNewsRecipe):
|
||||
def preprocess_html(self, soup):
|
||||
if h2 := soup.find('h2'):
|
||||
h2.name = 'p'
|
||||
for also in soup.findAll('h2'):
|
||||
if self.tag_to_string(also).strip().startswith('Also'):
|
||||
also.extract()
|
||||
for img in soup.findAll('img', attrs={'data-img': True}):
|
||||
img['src'] = img['data-img']
|
||||
return soup
|
||||
@ -95,6 +98,7 @@ class LiveMint(BasicNewsRecipe):
|
||||
classes('contentSec')
|
||||
]
|
||||
remove_tags = [
|
||||
dict(name=['meta', 'link', 'svg', 'button', 'iframe']),
|
||||
classes(
|
||||
'trendingSimilarHeight moreNews mobAppDownload label msgError msgOk taboolaHeight'
|
||||
' socialHolder imgbig disclamerText disqus-comment-count openinApp2 lastAdSlot'
|
||||
@ -138,6 +142,9 @@ class LiveMint(BasicNewsRecipe):
|
||||
return raw
|
||||
|
||||
def preprocess_html(self, soup):
|
||||
for strong in soup.findAll('strong'):
|
||||
if strong.find('p'):
|
||||
strong.name = 'div'
|
||||
for embed in soup.findAll('div', attrs={'class':'embed'}):
|
||||
if nos := embed.find('noscript'):
|
||||
nos.name = 'span'
|
||||
|
Loading…
x
Reference in New Issue
Block a user