diff --git a/recipes/economist.recipe b/recipes/economist.recipe index a2113f1c2f..c251a57ee1 100644 --- a/recipes/economist.recipe +++ b/recipes/economist.recipe @@ -49,6 +49,8 @@ def process_node(node, html_parent): def load_article_from_json(raw, root): data = json.loads(raw)['props']['pageProps']['content'] # open('/t/raw.json', 'w').write(json.dumps(data, indent=2, sort_keys=True)) + if isinstance(data, list): + data = data[0] body = root.xpath('//body')[0] for child in tuple(body): body.remove(child) diff --git a/recipes/economist_free.recipe b/recipes/economist_free.recipe index a2113f1c2f..c251a57ee1 100644 --- a/recipes/economist_free.recipe +++ b/recipes/economist_free.recipe @@ -49,6 +49,8 @@ def process_node(node, html_parent): def load_article_from_json(raw, root): data = json.loads(raw)['props']['pageProps']['content'] # open('/t/raw.json', 'w').write(json.dumps(data, indent=2, sort_keys=True)) + if isinstance(data, list): + data = data[0] body = root.xpath('//body')[0] for child in tuple(body): body.remove(child)