From 6e051c4b54973740df707c59d3e4f258f01f4155 Mon Sep 17 00:00:00 2001 From: Bezleputh Date: Wed, 11 Jun 2014 15:18:21 +0200 Subject: [PATCH] [twitter] fix bug when twitter lies to us saying there are more results and returns an empty page --- modules/twitter/pages.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/twitter/pages.py b/modules/twitter/pages.py index ce7ac59d..194a6592 100644 --- a/modules/twitter/pages.py +++ b/modules/twitter/pages.py @@ -52,7 +52,8 @@ class TwitterJsonHTMLPage(JsonPage): self.scroll_cursor = self.doc['scroll_cursor'] self.has_next = self.doc['has_more_items'] - self.doc = html.parse(StringIO(self.doc['items_html']), parser) + el = html.parse(StringIO(self.doc['items_html']), parser) + self.doc = el if el.getroot() is not None else html.Element('brinbrin') class LoginPage(HTMLPage):