mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Merge branch 'master' of https://github.com/hehonghui/calibre
This commit is contained in:
commit
5a69e8841c
@ -87,7 +87,12 @@ class TheAtlantic(BasicNewsRecipe):
|
|||||||
|
|
||||||
def preprocess_html(self, soup):
|
def preprocess_html(self, soup):
|
||||||
for img in soup.findAll('img', attrs={'data-srcset': True}):
|
for img in soup.findAll('img', attrs={'data-srcset': True}):
|
||||||
img['src'] = img['data-srcset'].split()[0]
|
#img['src'] = img['data-srcset'].split()[0]
|
||||||
|
data_srcset = img['data-srcset']
|
||||||
|
if ',' in data_srcset:
|
||||||
|
img['src'] = data_srcset.split(',')[0]
|
||||||
|
else:
|
||||||
|
img['src'] = data_srcset.split()[0]
|
||||||
for img in soup.findAll('img', attrs={'data-src': True}):
|
for img in soup.findAll('img', attrs={'data-src': True}):
|
||||||
img['src'] = img['data-src']
|
img['src'] = img['data-src']
|
||||||
return soup
|
return soup
|
||||||
|
@ -87,7 +87,12 @@ class TheAtlantic(BasicNewsRecipe):
|
|||||||
|
|
||||||
def preprocess_html(self, soup):
|
def preprocess_html(self, soup):
|
||||||
for img in soup.findAll('img', attrs={'data-srcset': True}):
|
for img in soup.findAll('img', attrs={'data-srcset': True}):
|
||||||
img['src'] = img['data-srcset'].split()[0]
|
#img['src'] = img['data-srcset'].split()[0]
|
||||||
|
data_srcset = img['data-srcset']
|
||||||
|
if ',' in data_srcset:
|
||||||
|
img['src'] = data_srcset.split(',')[0]
|
||||||
|
else:
|
||||||
|
img['src'] = data_srcset.split()[0]
|
||||||
for img in soup.findAll('img', attrs={'data-src': True}):
|
for img in soup.findAll('img', attrs={'data-src': True}):
|
||||||
img['src'] = img['data-src']
|
img['src'] = img['data-src']
|
||||||
return soup
|
return soup
|
||||||
|
Loading…
x
Reference in New Issue
Block a user