mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04: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
@ -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 @@ class Economist(BasicNewsRecipe):
|
|||||||
|
|
||||||
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…
x
Reference in New Issue
Block a user