mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Update New Scientist
This commit is contained in:
parent
98c83d2dec
commit
391e9d3f39
@ -64,13 +64,21 @@ class NewScientist(BasicNewsRecipe):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
keep_only_tags = [
|
keep_only_tags = [
|
||||||
classes('article-header article-conten')
|
classes('article-header article__content')
|
||||||
]
|
]
|
||||||
|
|
||||||
remove_tags = [
|
remove_tags = [
|
||||||
classes('social__button-container')
|
classes('social__button-container')
|
||||||
]
|
]
|
||||||
|
|
||||||
|
def preprocess_html(self, soup):
|
||||||
|
for img in soup.findAll('img', attrs={'data-src': True}):
|
||||||
|
img['src'] = img['data-src']
|
||||||
|
for img in soup.findAll('img', attrs={'data-srcset': True}):
|
||||||
|
img['src'] = img['data-srcset'].split(',')[-1].strip().split()[0]
|
||||||
|
img['width'] = img['height'] = ''
|
||||||
|
return soup
|
||||||
|
|
||||||
def get_article_url(self, article):
|
def get_article_url(self, article):
|
||||||
ans = BasicNewsRecipe.get_article_url(self, article)
|
ans = BasicNewsRecipe.get_article_url(self, article)
|
||||||
return ans.partition('?')[0]
|
return ans.partition('?')[0]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user