use static IDs of accounts
This commit is contained in:
parent
89b5c8b0e8
commit
5f9536f61d
3 changed files with 7 additions and 8 deletions
|
|
@ -61,8 +61,6 @@ class INGBackend(BaseBackend, ICapBank):
|
||||||
yield account
|
yield account
|
||||||
|
|
||||||
def get_account(self, _id):
|
def get_account(self, _id):
|
||||||
if not _id.isdigit():
|
|
||||||
raise AccountNotFound()
|
|
||||||
with self.browser:
|
with self.browser:
|
||||||
account = self.browser.get_account(_id)
|
account = self.browser.get_account(_id)
|
||||||
if account:
|
if account:
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ class Ing(BaseBrowser):
|
||||||
elif account.label[0:2] == "LA":
|
elif account.label[0:2] == "LA":
|
||||||
# we want "displayTRHistoriqueLA" but this fucking page
|
# we want "displayTRHistoriqueLA" but this fucking page
|
||||||
# is not directly available...
|
# is not directly available...
|
||||||
self.location('https://secure.ingdirect.fr/general?command=goToAccount&account=%d&zone=COMPTE' % int(id))
|
self.location('https://secure.ingdirect.fr/general?command=goToAccount&account=%d&zone=COMPTE' % int(account._index))
|
||||||
else:
|
else:
|
||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
while 1:
|
while 1:
|
||||||
|
|
|
||||||
|
|
@ -34,14 +34,15 @@ class AccountsList(BasePage):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def get_list(self):
|
def get_list(self):
|
||||||
ids = []
|
ids = set()
|
||||||
for td in self.document.xpath('.//td[@nowrap="nowrap"]'):
|
for td in self.document.xpath('.//td[@nowrap="nowrap"]'):
|
||||||
account = Account()
|
account = Account()
|
||||||
link = td.xpath('.//a')[0]
|
link = td.xpath('.//a')[0]
|
||||||
account.id = re.search('\d', link.attrib['href']).group(0)
|
account._index = int(re.search('\d', link.attrib['href']).group(0))
|
||||||
if not (account.id in ids):
|
if not account._index in ids:
|
||||||
ids.append(account.id)
|
ids.add(account._index)
|
||||||
account.label = unicode(link.text)
|
account.id = unicode(link.text.strip())
|
||||||
|
account.label = account.id
|
||||||
urltofind = './/a[@href="' + link.attrib['href'] + '"]'
|
urltofind = './/a[@href="' + link.attrib['href'] + '"]'
|
||||||
linkbis = self.document.xpath(urltofind).pop()
|
linkbis = self.document.xpath(urltofind).pop()
|
||||||
if linkbis.text == link.text:
|
if linkbis.text == link.text:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue