Update NY Times

Fixes #843 (NYTimes update)
This commit is contained in:
Kovid Goyal 2018-05-31 18:28:20 +05:30
parent c90a748839
commit ff78450ee7
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 10 additions and 0 deletions

View File

@ -120,6 +120,11 @@ class NewYorkTimes(BasicNewsRecipe):
t = soup.find(**classes('dateline')) t = soup.find(**classes('dateline'))
if t is not None: if t is not None:
t.insert(0, ' ') t.insert(0, ' ')
# Remove empty li tags
for li in soup.findAll('li', attrs={'class': lambda x: x and x.startswith('css-')}):
if not li.contents and not li.string:
li.extract()
return soup return soup
def read_nyt_metadata(self): def read_nyt_metadata(self):

View File

@ -120,6 +120,11 @@ class NewYorkTimes(BasicNewsRecipe):
t = soup.find(**classes('dateline')) t = soup.find(**classes('dateline'))
if t is not None: if t is not None:
t.insert(0, ' ') t.insert(0, ' ')
# Remove empty li tags
for li in soup.findAll('li', attrs={'class': lambda x: x and x.startswith('css-')}):
if not li.contents and not li.string:
li.extract()
return soup return soup
def read_nyt_metadata(self): def read_nyt_metadata(self):