From 3e8b59dbd00a84ce7a226be216b9ec11722c81de Mon Sep 17 00:00:00 2001 From: Christophe Benz Date: Sat, 10 Jul 2010 22:01:41 +0200 Subject: [PATCH] raise ExpectedElementNotFound if nb charms not found --- weboob/backends/aum/pages/home.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/weboob/backends/aum/pages/home.py b/weboob/backends/aum/pages/home.py index 7db76d04..f4c6569d 100644 --- a/weboob/backends/aum/pages/home.py +++ b/weboob/backends/aum/pages/home.py @@ -18,6 +18,7 @@ import re +from weboob.tools.browser import ExpectedElementNotFound from weboob.backends.aum.pages.base import PageBase from logging import error @@ -39,15 +40,11 @@ class HomePage(PageBase): tables = self.document.getElementsByTagName('table') for table in tables: if table.hasAttribute('style') and table.getAttribute('style') == 'background-color:black;background-image:url(http://s.adopteunmec.com/img/barmec.gif);background-repeat:no-repeat': - fonts = table.getElementsByTagName('font') i = 0 - for font in fonts: if font.hasAttribute('color') and font.getAttribute('color') == '#ff0198': i += 1 if i == 3: return int(font.firstChild.data) - - error('Error: Unable to find the available charms counter') - return 0 + raise ExpectedElementNotFound(u'Could not parse number of charms available')