1
0
Fork 0

Compare commits

..

3 Commits

Author SHA1 Message Date
Dustin 4120804dc4 chase: Fix login form fill
Chase loves to make subtle, invisible changes to their website,
presumably to break screen scrapers like this.
2024-05-17 10:10:41 -05:00
Dustin 2890597673 chase: Update card button text
Chase changed the name of my credit card from *CREDIT CARD* to *Amazon
Visa*.  Just in case they change it again or something, let's match only
on the card number.
2024-03-24 10:58:42 -05:00
Dustin dd0edc599e chase: Ensure transaction list is not empty
By default, the transaction list for the Chase credit card shows
transactions that have posted since the last statement.  This list can
sometimes be empty, particularly on the day the the statement is issued.
When this is the case, clicking the _Download Account Activity_ button
does not work; it simply displays a message stating "There's no account
activity showing to download."  Since we are going to adjust the date
range on the download form anyway, it doesn't matter what's showing,
we just need the button to work. Thus, we now set the page show all
transactions and then click the button.
2024-03-11 13:26:48 -05:00
1 changed files with 10 additions and 7 deletions

View File

@ -580,12 +580,12 @@ class Chase:
self.page.wait_for_timeout(random.randint(2000, 4000)) self.page.wait_for_timeout(random.randint(2000, 4000))
password = rbw_get(self.vault_item, self.vault_folder, self.username) password = rbw_get(self.vault_item, self.vault_folder, self.username)
log.debug('Filling username/password login form') log.debug('Filling username/password login form')
self.page.frame_locator('#logonbox').locator( self.page.frame_locator('#logonbox').get_by_label('Username').fill(
'input[name=userId]' self.username
).fill(self.username) )
self.page.frame_locator('#logonbox').locator( self.page.frame_locator('#logonbox').get_by_label('Password').fill(
'input[name=password]' password
).fill(password) )
self.page.wait_for_timeout(random.randint(500, 750)) self.page.wait_for_timeout(random.randint(500, 750))
self.page.frame_locator('#logonbox').get_by_role( self.page.frame_locator('#logonbox').get_by_role(
'button', name='Sign in' 'button', name='Sign in'
@ -604,7 +604,7 @@ class Chase:
log.info('Downloading transactions from %s to %s', from_date, to_date) log.info('Downloading transactions from %s to %s', from_date, to_date)
fmt = '%m/%d/%Y' fmt = '%m/%d/%Y'
self.page.locator('#CARD_ACCOUNTS').get_by_role( self.page.locator('#CARD_ACCOUNTS').get_by_role(
'button', name='CREDIT CARD (...2467)' 'button', name='(...2467)'
).first.click() ).first.click()
fl = self.page.locator('#flyout') fl = self.page.locator('#flyout')
fl.wait_for() fl.wait_for()
@ -613,6 +613,9 @@ class Chase:
'button', name='Account activity', exact=True 'button', name='Account activity', exact=True
).wait_for() ).wait_for()
fl.get_by_role('link', name='Show details').wait_for() fl.get_by_role('link', name='Show details').wait_for()
fl.get_by_role('link', name='Activity since last statement').click()
fl.get_by_role('link', name='All transactions').click()
fl.get_by_text('See more activity').wait_for()
fl.get_by_role('button', name='Download Account Activity').click() fl.get_by_role('button', name='Download Account Activity').click()
log.debug('Filling account activity download form') log.debug('Filling account activity download form')
self.page.locator('#select-downloadActivityOptionId-label').click() self.page.locator('#select-downloadActivityOptionId-label').click()