support market page (but do not display any history)
This commit is contained in:
parent
cc31e73f23
commit
db52ac2619
2 changed files with 17 additions and 11 deletions
|
|
@ -21,7 +21,7 @@
|
||||||
from weboob.tools.browser import BaseBrowser, BrowserIncorrectPassword
|
from weboob.tools.browser import BaseBrowser, BrowserIncorrectPassword
|
||||||
|
|
||||||
from .pages import LoginPage, Login2Page, IndexPage, AccountsPage, TransactionsPage, \
|
from .pages import LoginPage, Login2Page, IndexPage, AccountsPage, TransactionsPage, \
|
||||||
CardPage, ValuationPage, LoanPage
|
CardPage, ValuationPage, LoanPage, MarketPage
|
||||||
|
|
||||||
|
|
||||||
__all__ = ['Barclays']
|
__all__ = ['Barclays']
|
||||||
|
|
@ -38,6 +38,7 @@ class Barclays(BaseBrowser):
|
||||||
'https://.*.barclays.fr/barclaysnetV2/cartes.do.*': CardPage,
|
'https://.*.barclays.fr/barclaysnetV2/cartes.do.*': CardPage,
|
||||||
'https://.*.barclays.fr/barclaysnetV2/valuationViewBank.do.*': ValuationPage,
|
'https://.*.barclays.fr/barclaysnetV2/valuationViewBank.do.*': ValuationPage,
|
||||||
'https://.*.barclays.fr/barclaysnetV2/pret.do.*': LoanPage,
|
'https://.*.barclays.fr/barclaysnetV2/pret.do.*': LoanPage,
|
||||||
|
'https://.*.barclays.fr/barclaysnetV2/titre.do.*': MarketPage,
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, secret, *args, **kwargs):
|
def __init__(self, secret, *args, **kwargs):
|
||||||
|
|
@ -101,7 +102,7 @@ class Barclays(BaseBrowser):
|
||||||
|
|
||||||
self.location(account._link)
|
self.location(account._link)
|
||||||
|
|
||||||
assert self.is_on_page((TransactionsPage, ValuationPage, LoanPage))
|
assert self.is_on_page((TransactionsPage, ValuationPage, LoanPage, MarketPage))
|
||||||
|
|
||||||
for tr in self.page.get_history():
|
for tr in self.page.get_history():
|
||||||
yield tr
|
yield tr
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ from weboob.tools.capabilities.bank.transactions import FrenchTransaction
|
||||||
|
|
||||||
|
|
||||||
__all__ = ['LoginPage', 'Login2Page', 'IndexPage', 'AccountsPage', 'TransactionsPage',
|
__all__ = ['LoginPage', 'Login2Page', 'IndexPage', 'AccountsPage', 'TransactionsPage',
|
||||||
'CardPage', 'ValuationPage', 'LoanPage']
|
'CardPage', 'ValuationPage', 'LoanPage', 'MarketPage']
|
||||||
|
|
||||||
|
|
||||||
class LoginPage(BasePage):
|
class LoginPage(BasePage):
|
||||||
|
|
@ -127,8 +127,12 @@ class Transaction(FrenchTransaction):
|
||||||
FrenchTransaction.TYPE_UNKNOWN),
|
FrenchTransaction.TYPE_UNKNOWN),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
class HistoryBasePage(BasePage):
|
||||||
|
def get_history(self):
|
||||||
|
self.logger.warning('Do not support account of type %s' % type(self).__name__)
|
||||||
|
return iter([])
|
||||||
|
|
||||||
class TransactionsPage(BasePage):
|
class TransactionsPage(HistoryBasePage):
|
||||||
def get_history(self):
|
def get_history(self):
|
||||||
for tr in self.document.xpath('//table[@id="operation"]/tbody/tr'):
|
for tr in self.document.xpath('//table[@id="operation"]/tbody/tr'):
|
||||||
tds = tr.findall('td')
|
tds = tr.findall('td')
|
||||||
|
|
@ -152,7 +156,7 @@ class TransactionsPage(BasePage):
|
||||||
yield t
|
yield t
|
||||||
|
|
||||||
|
|
||||||
class CardPage(BasePage):
|
class CardPage(HistoryBasePage):
|
||||||
def get_history(self):
|
def get_history(self):
|
||||||
debit_date = None
|
debit_date = None
|
||||||
coming = True
|
coming = True
|
||||||
|
|
@ -182,10 +186,11 @@ class CardPage(BasePage):
|
||||||
t.set_amount(amount)
|
t.set_amount(amount)
|
||||||
yield t
|
yield t
|
||||||
|
|
||||||
class ValuationPage(BasePage):
|
class ValuationPage(HistoryBasePage):
|
||||||
def get_history(self):
|
pass
|
||||||
return iter([])
|
|
||||||
|
|
||||||
class LoanPage(BasePage):
|
class LoanPage(HistoryBasePage):
|
||||||
def get_history(self):
|
pass
|
||||||
return iter([])
|
|
||||||
|
class MarketPage(HistoryBasePage):
|
||||||
|
pass
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue