diff --git a/modules/cragr/web/browser.py b/modules/cragr/web/browser.py index 39268658..0c537adf 100644 --- a/modules/cragr/web/browser.py +++ b/modules/cragr/web/browser.py @@ -175,7 +175,7 @@ class Cragr(BaseBrowser): for tr in self.page.get_history(date_guesser): yield tr else: - url = account._link + url = self.page.get_order_by_date_url() while url: self.location(url) diff --git a/modules/cragr/web/pages.py b/modules/cragr/web/pages.py index 22d98363..c795b74b 100644 --- a/modules/cragr/web/pages.py +++ b/modules/cragr/web/pages.py @@ -245,6 +245,13 @@ class TransactionsPage(BasePage): return None + def get_order_by_date_url(self): + try: + link = self.document.xpath('//table[@class="ca-table"]/thead//a[text()="Date"]')[0].attrib['href'] + except IndexError: + link = self.url + return link + COL_DATE = 0 COL_TEXT = 1 COL_DEBIT = None