From 2afe48db480004676cdc228c723ae260d9ff48ac Mon Sep 17 00:00:00 2001 From: Vincent Paredes Date: Fri, 28 Mar 2014 17:26:59 +0100 Subject: [PATCH] checking if the card is valid --- modules/americanexpress/pages.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/americanexpress/pages.py b/modules/americanexpress/pages.py index 4dab6b1f..b500a07e 100644 --- a/modules/americanexpress/pages.py +++ b/modules/americanexpress/pages.py @@ -104,6 +104,10 @@ class TransactionsPage(BasePage): MONTHS = ['janv', u'févr', u'mars', u'avr', u'mai', u'juin', u'juil', u'août', u'sept', u'oct', u'nov', u'déc'] def get_history(self): + #checking if the card is still valid + if self.document.xpath('//div[@id="errorbox"]'): + return + #adding a time delta because amex have hard time to put the date in a good interval beginning_date = self.get_beginning_debit_date() - datetime.timedelta(days=90) end_date = self.get_end_debit_date()