handling html page

This commit is contained in:
Vincent Paredes 2015-04-07 16:00:07 +02:00 committed by Romain Bignon
commit a5a83047cc
2 changed files with 7 additions and 4 deletions

View file

@ -49,9 +49,12 @@ class CreditMutuelBrowser(LoginBrowser):
'/(?P<subbank>.*)/fr/banques/accueil.html',
LoginPage)
login_error = URL('/(?P<subbank>.*)/fr/identification/default.cgi', LoginErrorPage)
accounts = URL('/(?P<subbank>.*)/fr/banque/situation_financiere.cgi', AccountsPage)
accounts = URL('/(?P<subbank>.*)/fr/banque/situation_financiere.cgi',
'/(?P<subbank>.*)/fr/banque/situation_financiere.html',
AccountsPage)
user_space = URL('/(?P<subbank>.*)/fr/banque/espace_personnel.aspx', UserSpacePage)
operations = URL('/(?P<subbank>.*)/fr/banque/mouvements.cgi.*',
'/(?P<subbank>.*)/fr/banque/mouvements.html.*',
'/(?P<subbank>.*)/fr/banque/nr/nr_devbooster.aspx.*',
OperationsPage)
coming = URL('/(?P<subbank>.*)/fr/banque/mvts_instance.cgi.*', ComingPage)
@ -102,7 +105,7 @@ class CreditMutuelBrowser(LoginBrowser):
self.currentSubBank = url.path.lstrip('/').split('/')[0]
def list_operations(self, page_url):
if page_url.startswith('/'):
if page_url.startswith('/') or page_url.startswith('https'):
self.location(page_url)
else:
self.location('%s/%s/fr/banque/%s' % (self.BASEURL, self.currentSubBank, page_url))

View file

@ -116,7 +116,7 @@ class AccountsPage(LoggedPage, HTMLPage):
return False
first_td = self.el.xpath('./td')[0]
return ((first_td.attrib.get('class', '') == 'i g' or first_td.attrib.get('class', '') == 'p g')
return (("i" in first_td.attrib.get('class', '') or "p" in first_td.attrib.get('class', ''))
and first_td.find('a') is not None)
class Label(Filter):
@ -222,7 +222,7 @@ class OperationsPage(LoggedPage, HTMLPage):
item_xpath = '//table[@class="liste"]//tbody/tr'
class item(Transaction.TransactionElement):
condition = lambda self: len(self.el.xpath('./td')) >= 4 and len(self.el.xpath('./td[@class="i g" or @class="p g" or contains(@class, "_c1 c _c1")]')) > 0
condition = lambda self: len(self.el.xpath('./td')) >= 4 and len(self.el.xpath('./td[@class="i g" or @class="p g" or contains(@class, "_c1")]')) > 0
class OwnRaw(Filter):
def __call__(self, item):