mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-06 10:05:38 +01:00
Fix #1943193 [economist recipe TypeError: Argument must be bytes or unicode, got 'NoneType'](https://bugs.launchpad.net/calibre/+bug/1943193)
This commit is contained in:
parent
56d79c597b
commit
a0cc6d6c68
2 changed files with 3 additions and 3 deletions
|
|
@ -31,7 +31,7 @@ def process_node(node, html_parent):
|
||||||
ntype = node.get('type')
|
ntype = node.get('type')
|
||||||
if ntype == 'tag':
|
if ntype == 'tag':
|
||||||
c = html_parent.makeelement(node['name'])
|
c = html_parent.makeelement(node['name'])
|
||||||
c.attrib.update(node.get('attribs', {}))
|
c.attrib.update({k: v or '' for k, v in node.get('attribs', {}).items()})
|
||||||
html_parent.append(c)
|
html_parent.append(c)
|
||||||
for nc in node.get('children', ()):
|
for nc in node.get('children', ()):
|
||||||
process_node(nc, c)
|
process_node(nc, c)
|
||||||
|
|
@ -236,7 +236,7 @@ def publication_date(self):
|
||||||
|
|
||||||
def parse_index(self):
|
def parse_index(self):
|
||||||
# return [('Articles', [{'title':'test',
|
# return [('Articles', [{'title':'test',
|
||||||
# 'url':'file:///t/raw.html'
|
# 'url':'https://www.economist.com/briefing/2021/09/11/how-america-wasted-its-unipolar-moment'
|
||||||
# }])]
|
# }])]
|
||||||
if edition_date:
|
if edition_date:
|
||||||
url = 'https://www.economist.com/weeklyedition/' + edition_date
|
url = 'https://www.economist.com/weeklyedition/' + edition_date
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ def process_node(node, html_parent):
|
||||||
ntype = node.get('type')
|
ntype = node.get('type')
|
||||||
if ntype == 'tag':
|
if ntype == 'tag':
|
||||||
c = html_parent.makeelement(node['name'])
|
c = html_parent.makeelement(node['name'])
|
||||||
c.attrib.update(node.get('attribs', {}))
|
c.attrib.update({k: v or '' for k, v in node.get('attribs', {}).items()})
|
||||||
html_parent.append(c)
|
html_parent.append(c)
|
||||||
for nc in node.get('children', ()):
|
for nc in node.get('children', ()):
|
||||||
process_node(nc, c)
|
process_node(nc, c)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue