Credit limit, payment due date and amount for Citibank. Closes #1719
This commit is contained in:
parent
6427cd3bb4
commit
34fe15f4ce
1 changed files with 25 additions and 4 deletions
|
|
@ -88,12 +88,29 @@ class Citibank(object):
|
||||||
|
|
||||||
def iter_accounts(self):
|
def iter_accounts(self):
|
||||||
self.start()
|
self.start()
|
||||||
bal = self.wait('div.cT-valueItem span.cT-balanceIndicator1')[0].text
|
self._account_link().click()
|
||||||
|
self.wait_ajax()
|
||||||
|
label = self.wait('label#accountSingle .cS-accountMenuAccount')[0].text
|
||||||
|
bal = self._browser.find_elements_by_xpath(u'//span[contains(text(),'
|
||||||
|
'"Current Balance:")]/../../div[@class="cT-valueItem"]')[0].text
|
||||||
|
cardlimit = self._browser.find_elements_by_xpath(
|
||||||
|
u'//span[contains(text(),"Total Revolving Credit Line:")]'
|
||||||
|
'/../../div[@class="cT-valueItem"]')[0].text
|
||||||
|
paydue=self._browser.find_elements_by_xpath(u'//span[contains(text(),'
|
||||||
|
'"Minimum Payment Due") and @role="gridcell"]')[0].text
|
||||||
|
paydate = re.match(u'Minimum Payment Due.On (..-..-....):', paydue,
|
||||||
|
re.DOTALL + re.UNICODE).group(1)
|
||||||
|
paymin = self._browser.find_elements_by_xpath(
|
||||||
|
u'//span[contains(text(),"Minimum Payment Due")]'
|
||||||
|
'/../../div[contains(@class,"cT-valueItem")]')[0].text
|
||||||
account = Account()
|
account = Account()
|
||||||
account.id = self._account_id()
|
account.id = label[-4:]
|
||||||
account.label = self._account_link().text
|
account.label = label
|
||||||
account.currency = Account.get_currency(bal)
|
account.currency = Account.get_currency(bal)
|
||||||
account.balance = -AmTr.decimal_amount(bal)
|
account.balance = -AmTr.decimal_amount(bal)
|
||||||
|
account.cardlimit = AmTr.decimal_amount(cardlimit)
|
||||||
|
account.paydate = datetime.datetime.strptime(paydate, '%m-%d-%Y')
|
||||||
|
account.paymin = AmTr.decimal_amount(paymin)
|
||||||
account.type = Account.TYPE_CARD
|
account.type = Account.TYPE_CARD
|
||||||
self.finish()
|
self.finish()
|
||||||
yield account
|
yield account
|
||||||
|
|
@ -233,11 +250,15 @@ class Citibank(object):
|
||||||
|
|
||||||
@retrying
|
@retrying
|
||||||
def wait_ajax(self):
|
def wait_ajax(self):
|
||||||
|
from selenium.common.exceptions import StaleElementReferenceException
|
||||||
self._logger.debug('Waiting for async requests to finish on page %s'
|
self._logger.debug('Waiting for async requests to finish on page %s'
|
||||||
% self._browser.current_url)
|
% self._browser.current_url)
|
||||||
els = self._browser.find_elements_by_xpath(
|
els = self._browser.find_elements_by_xpath(
|
||||||
u'//*[contains(text(),"Please wait")]')
|
u'//*[contains(text(),"Please wait")]')
|
||||||
if not els or any(x.is_displayed() for x in els):
|
try:
|
||||||
|
if not els or any(x.is_displayed() for x in els):
|
||||||
|
raise OnceAgain()
|
||||||
|
except StaleElementReferenceException:
|
||||||
raise OnceAgain()
|
raise OnceAgain()
|
||||||
|
|
||||||
@retrying
|
@retrying
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue