From 6deaa9ac44abcbb535b48928b539ff39bfce921e Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Mon, 23 Apr 2012 11:31:28 +0200 Subject: [PATCH] use a better workaround --- modules/ing/browser.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/ing/browser.py b/modules/ing/browser.py index d405d936..e65b0406 100644 --- a/modules/ing/browser.py +++ b/modules/ing/browser.py @@ -80,6 +80,11 @@ class Ing(BaseBrowser): return None + def viewing_html(self): + # To prevent unknown mimetypes sent by server, we assume we + # are always on a HTML document. + return True + def get_history(self, id): account = self.get_account(id) # The first and the second letter of the label are the account type @@ -96,6 +101,7 @@ class Ing(BaseBrowser): yield transaction if self.page.islast(): return + + # XXX server sends an unknown mimetype, we overload viewing_html() above to + # prevent this issue. self.page.next_page() - # The answer is not a valide html page for mechanize, we have to be tolerant - self._factory.is_html = True