[twitter] fix bug when twitter lies to us saying there are more results and returns an empty page

This commit is contained in:
Bezleputh 2014-06-17 13:42:16 +02:00 committed by Florent
commit b163888988

View file

@ -52,8 +52,11 @@ class TwitterJsonHTMLPage(JsonPage):
self.scroll_cursor = self.doc['scroll_cursor']
self.has_next = self.doc['has_more_items']
el = html.parse(StringIO(self.doc['items_html']), parser)
self.doc = el if el.getroot() is not None else html.Element('brinbrin')
if self.doc['items_html']:
el = html.parse(StringIO(self.doc['items_html']), parser)
self.doc = el if el.getroot() is not None else html.Element('brinbrin')
else:
self.doc = html.Element('brinbrin')
class LoginPage(HTMLPage):