From d1c947c549700be119d62ca2fa9beeecf0d1f510 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Mon, 24 Jul 2023 11:17:50 -0500 Subject: [PATCH] chase: Fixes for site updates Chase made some minor updates to their site recently which affected some of the element locators. The propaganda in the right-hand column of the landing page has changed, and the Downlod Account Activity form is still really terrible, and now behaves even more strangely. --- xactfetch.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/xactfetch.py b/xactfetch.py index 37747c1..f25156e 100644 --- a/xactfetch.py +++ b/xactfetch.py @@ -568,8 +568,9 @@ class Chase: ).click() log.debug('Waiting for page load') self.page.wait_for_load_state() - self.page.get_by_text('Amazon Rewards points').wait_for(timeout=60000) - self.page.get_by_role('button', name='Open an account').wait_for() + self.page.get_by_role('button', name='Pay Card').wait_for( + timeout=120000 + ) log.info('Successfully logged in to Chase') self._logged_in = True @@ -578,15 +579,14 @@ class Chase: ) -> Path: log.info('Downloading transactions from %s to %s', from_date, to_date) fmt = '%m/%d/%Y' - href = '#/dashboard/accountDetails/downloadAccountTransactions/index' - self.page.evaluate(f'window.location.href = "{href}";') - log.debug('Waiting for page to load') - s = self.page.locator('button#select-downloadActivityOptionId') - s.wait_for() + self.page.get_by_role( + 'button', name='CREDIT CARD (...2467)' + ).first.click() + self.page.get_by_role( + 'button', name='Download Account Activity' + ).click() log.debug('Filling account activity download form') - self.page.locator('button#select-account-selector').click() - self.page.get_by_text('CREDIT CARD').nth(1).locator('../..').click() - s.click() + self.page.get_by_text('Activity', exact=True).click() self.page.get_by_text('Choose a date range').nth(1).locator( '../..' ).click()