mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-25 06:05:25 +01:00
Fix #8756 (WSJ Recipe displays brackets on articles without page metadata)
This commit is contained in:
parent
f1acc1d84c
commit
e3cf114c68
2 changed files with 10 additions and 2 deletions
|
|
@ -158,7 +158,11 @@ def wsj_find_articles(self, url):
|
|||
meta = a.find(attrs={'class':'meta_sectionName'})
|
||||
if meta is not None:
|
||||
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']
|
||||
desc = ''
|
||||
for p in container.findAll('p'):
|
||||
|
|
|
|||
|
|
@ -140,7 +140,11 @@ def wsj_find_articles(self, url):
|
|||
meta = a.find(attrs={'class':'meta_sectionName'})
|
||||
if meta is not None:
|
||||
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']
|
||||
desc = ''
|
||||
for p in container.findAll('p'):
|
||||
|
|
|
|||
Loading…
Reference in a new issue