From e972119109f0a0ea1b4e622b75124efbe3031649 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 7 Oct 2017 10:41:53 +0530 Subject: [PATCH] ... --- recipes/ap.recipe | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/recipes/ap.recipe b/recipes/ap.recipe index 6537d649a3..df312a47c6 100644 --- a/recipes/ap.recipe +++ b/recipes/ap.recipe @@ -55,13 +55,15 @@ def parse_section(self, front): self.log('Processing section:', front, 'at', url) data = self.index_to_soup(url, raw=True) data = json.loads(data) + from pprint import pformat + open('/t/raw', 'wb').write(pformat(data)) cards = data.get('cards', ()) articles = [] for card in cards: for article in card['contents']: url = article['localLinkUrl'] - title = article.get('flattenedFirstWords') + title = article.get('headline', article.get('flattenedFirstWords')) if not title: continue title = title.split('\u2014')[-1]