Remove srcset attribute from images in economist and new york review of books

This commit is contained in:
Kovid Goyal 2017-08-30 18:37:47 +05:30
parent 181f595294
commit 7fd413d392
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 9 additions and 0 deletions

View File

@ -246,6 +246,8 @@ class Economist(BasicNewsRecipe):
yield x
def postprocess_html(self, soup, first):
for img in soup.findAll('img', srcset=True):
del img['srcset']
for table in list(self.eco_find_image_tables(soup)):
caption = table.find('font')
img = table.find('img')

View File

@ -246,6 +246,8 @@ class Economist(BasicNewsRecipe):
yield x
def postprocess_html(self, soup, first):
for img in soup.findAll('img', srcset=True):
del img['srcset']
for table in list(self.eco_find_image_tables(soup)):
caption = table.find('font')
img = table.find('img')

View File

@ -66,6 +66,11 @@ class NewYorkReviewOfBooks(BasicNewsRecipe):
i.extract()
return soup
def postprocess_html(self, soup, first):
for img in soup.findAll('img', srcset=True):
del img['srcset']
return soup
def parse_index(self):
soup = self.index_to_soup('http://www.nybooks.com/current-issue')