mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-31 14:33:54 -04:00
Update WSJ to include A-hed article
This commit is contained in:
parent
f28ee68679
commit
6b4182da7b
@ -108,6 +108,23 @@ class WallStreetJournal(BasicNewsRecipe):
|
|||||||
title = self.tag_to_string(a)
|
title = self.tag_to_string(a)
|
||||||
url = self.abs_wsj_url(a['href'])
|
url = self.abs_wsj_url(a['href'])
|
||||||
feeds = self.wsj_add_feed(feeds,title,url)
|
feeds = self.wsj_add_feed(feeds,title,url)
|
||||||
|
|
||||||
|
for li in soup.findAll('li', attrs={'class':'ahed_listitem'}):
|
||||||
|
h2 = li.find('h2')
|
||||||
|
if h2 is None:
|
||||||
|
continue
|
||||||
|
a = h2.find('a', href=True)
|
||||||
|
if a is None:
|
||||||
|
continue
|
||||||
|
url = a['href']
|
||||||
|
title = self.tag_to_string(a)
|
||||||
|
p = h2.findNextSibling('p')
|
||||||
|
if p is not None:
|
||||||
|
desc = self.tag_to_string(p)
|
||||||
|
else:
|
||||||
|
desc = ''
|
||||||
|
if feeds:
|
||||||
|
feeds[0][1].append({'title':title, 'url':url, 'description':desc, 'date':''})
|
||||||
return feeds
|
return feeds
|
||||||
|
|
||||||
def wsj_find_wn_articles(self, url):
|
def wsj_find_wn_articles(self, url):
|
||||||
@ -167,7 +184,7 @@ class WallStreetJournal(BasicNewsRecipe):
|
|||||||
desc = ''
|
desc = ''
|
||||||
for p in container.findAll('p'):
|
for p in container.findAll('p'):
|
||||||
desc = self.tag_to_string(p)
|
desc = self.tag_to_string(p)
|
||||||
if not 'Subscriber Content' in desc:
|
if 'Subscriber Content' not in desc:
|
||||||
break
|
break
|
||||||
|
|
||||||
articles.append({'title':title, 'url':url,
|
articles.append({'title':title, 'url':url,
|
||||||
|
@ -91,6 +91,23 @@ class WallStreetJournal(BasicNewsRecipe):
|
|||||||
title = self.tag_to_string(a)
|
title = self.tag_to_string(a)
|
||||||
url = self.abs_wsj_url(a['href'])
|
url = self.abs_wsj_url(a['href'])
|
||||||
feeds = self.wsj_add_feed(feeds,title,url)
|
feeds = self.wsj_add_feed(feeds,title,url)
|
||||||
|
|
||||||
|
for li in soup.findAll('li', attrs={'class':'ahed_listitem'}):
|
||||||
|
h2 = li.find('h2')
|
||||||
|
if h2 is None:
|
||||||
|
continue
|
||||||
|
a = h2.find('a', href=True)
|
||||||
|
if a is None:
|
||||||
|
continue
|
||||||
|
url = a['href']
|
||||||
|
title = self.tag_to_string(a)
|
||||||
|
p = h2.findNextSibling('p')
|
||||||
|
if p is not None:
|
||||||
|
desc = self.tag_to_string(p)
|
||||||
|
else:
|
||||||
|
desc = ''
|
||||||
|
if feeds:
|
||||||
|
feeds[0][1].append({'title':title, 'url':url, 'description':desc, 'date':''})
|
||||||
return feeds
|
return feeds
|
||||||
|
|
||||||
def wsj_find_wn_articles(self, url):
|
def wsj_find_wn_articles(self, url):
|
||||||
@ -149,7 +166,7 @@ class WallStreetJournal(BasicNewsRecipe):
|
|||||||
desc = ''
|
desc = ''
|
||||||
for p in container.findAll('p'):
|
for p in container.findAll('p'):
|
||||||
desc = self.tag_to_string(p)
|
desc = self.tag_to_string(p)
|
||||||
if not 'Subscriber Content' in desc:
|
if 'Subscriber Content' not in desc:
|
||||||
break
|
break
|
||||||
|
|
||||||
articles.append({'title':title, 'url':url,
|
articles.append({'title':title, 'url':url,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user