mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 18:24:30 -04:00
Fix #8756 (WSJ Recipe displays brackets on articles without page metadata)
This commit is contained in:
parent
f1acc1d84c
commit
e3cf114c68
@ -158,7 +158,11 @@ class WallStreetJournal(BasicNewsRecipe):
|
|||||||
meta = a.find(attrs={'class':'meta_sectionName'})
|
meta = a.find(attrs={'class':'meta_sectionName'})
|
||||||
if meta is not None:
|
if meta is not None:
|
||||||
meta.extract()
|
meta.extract()
|
||||||
title = self.tag_to_string(a).strip() + ' [%s]'%self.tag_to_string(meta)
|
meta = self.tag_to_string(meta).strip()
|
||||||
|
if meta:
|
||||||
|
title = self.tag_to_string(a).strip() + ' [%s]'%meta
|
||||||
|
else:
|
||||||
|
title = self.tag_to_string(a).strip()
|
||||||
url = 'http://online.wsj.com'+a['href']
|
url = 'http://online.wsj.com'+a['href']
|
||||||
desc = ''
|
desc = ''
|
||||||
for p in container.findAll('p'):
|
for p in container.findAll('p'):
|
||||||
|
@ -140,7 +140,11 @@ class WallStreetJournal(BasicNewsRecipe):
|
|||||||
meta = a.find(attrs={'class':'meta_sectionName'})
|
meta = a.find(attrs={'class':'meta_sectionName'})
|
||||||
if meta is not None:
|
if meta is not None:
|
||||||
meta.extract()
|
meta.extract()
|
||||||
title = self.tag_to_string(a).strip() + ' [%s]'%self.tag_to_string(meta)
|
meta = self.tag_to_string(meta).strip()
|
||||||
|
if meta:
|
||||||
|
title = self.tag_to_string(a).strip() + ' [%s]'%meta
|
||||||
|
else:
|
||||||
|
title = self.tag_to_string(a).strip()
|
||||||
url = 'http://online.wsj.com'+a['href']
|
url = 'http://online.wsj.com'+a['href']
|
||||||
desc = ''
|
desc = ''
|
||||||
for p in container.findAll('p'):
|
for p in container.findAll('p'):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user