Fix ICapBill on the new website
This commit is contained in:
parent
a62ed69045
commit
832119fc3a
2 changed files with 24 additions and 16 deletions
|
|
@ -34,7 +34,7 @@ class Ing(BaseBrowser):
|
||||||
PROTOCOL = 'https'
|
PROTOCOL = 'https'
|
||||||
DEBUG_HTTP = False
|
DEBUG_HTTP = False
|
||||||
#DEBUG_HTTP = True
|
#DEBUG_HTTP = True
|
||||||
ENCODING = "utf-8"
|
ENCODING = None
|
||||||
PAGES = {'.*pages/index.jsf.*': AccountsList,
|
PAGES = {'.*pages/index.jsf.*': AccountsList,
|
||||||
'.*displayLogin.jsf.*': LoginPage,
|
'.*displayLogin.jsf.*': LoginPage,
|
||||||
'.*transferManagement.jsf': TransferPage,
|
'.*transferManagement.jsf': TransferPage,
|
||||||
|
|
@ -51,6 +51,7 @@ class Ing(BaseBrowser):
|
||||||
transferpage = '/protected/pages/cc/transfer/transferManagement.jsf'
|
transferpage = '/protected/pages/cc/transfer/transferManagement.jsf'
|
||||||
dotransferpage = '/general?command=DisplayDoTransferCommand'
|
dotransferpage = '/general?command=DisplayDoTransferCommand'
|
||||||
valtransferpage = '/protected/pages/cc/transfer/create/transferCreateValidation.jsf'
|
valtransferpage = '/protected/pages/cc/transfer/create/transferCreateValidation.jsf'
|
||||||
|
billpage = '/protected/pages/common/estatement/eStatement.jsf'
|
||||||
where = None
|
where = None
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
|
|
@ -189,8 +190,15 @@ class Ing(BaseBrowser):
|
||||||
|
|
||||||
def get_bills(self, subscription):
|
def get_bills(self, subscription):
|
||||||
if not self.is_on_page(BillsPage):
|
if not self.is_on_page(BillsPage):
|
||||||
self.location('/protected/pages/common/estatement/eStatement.jsf')
|
self.location(self.billpage)
|
||||||
self.page.selectyear(subscription._localid)
|
data = {"AJAXREQUEST": "_viewRoot",
|
||||||
|
"accountsel_form": "accountsel_form",
|
||||||
|
subscription._formid: subscription._formid,
|
||||||
|
"autoScroll": "",
|
||||||
|
"javax.faces.ViewState": subscription._javax,
|
||||||
|
"transfer_issuer_radio": subscription.id
|
||||||
|
}
|
||||||
|
self.location(self.billpage, urllib.urlencode(data))
|
||||||
while 1:
|
while 1:
|
||||||
for bill in self.page.iter_bills(subscription.id):
|
for bill in self.page.iter_bills(subscription.id):
|
||||||
yield bill
|
yield bill
|
||||||
|
|
|
||||||
|
|
@ -30,24 +30,24 @@ class BillsPage(BasePage):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def iter_account(self):
|
def iter_account(self):
|
||||||
ul = self.document.xpath('//ul[@id="accountsel_form:accountsel"]')
|
ul = self.document.xpath('//ul[@class="unstyled striped"]')
|
||||||
|
javax = self.document.xpath("//form[@id='accountsel_form']/input[@name='javax.faces.ViewState']")
|
||||||
|
javax = javax[0].attrib['value']
|
||||||
#subscriber = unicode(self.document.find('//h5').text)
|
#subscriber = unicode(self.document.find('//h5').text)
|
||||||
for li in ul[0].xpath('li/a'):
|
for li in ul[0].xpath('li'):
|
||||||
label = li.text
|
inputs = li.xpath('input')[0]
|
||||||
id = label.split(' ')[-1]
|
label = li.xpath('label')[0]
|
||||||
|
label = unicode(label.text)
|
||||||
|
formid = inputs.attrib['onclick']
|
||||||
|
formid = formid.split("parameters")[1]
|
||||||
|
formid = formid.split("'")[2]
|
||||||
|
id = inputs.attrib['value']
|
||||||
subscription = Subscription(id)
|
subscription = Subscription(id)
|
||||||
subscription.label = label
|
subscription.label = label
|
||||||
# subscription.subscriber = subscriber
|
subscription._formid = formid
|
||||||
subscription._localid = li.attrib['id']
|
subscription._javax = javax
|
||||||
yield subscription
|
yield subscription
|
||||||
|
|
||||||
def selectyear(self, id):
|
|
||||||
self.browser.select_form("accountsel_form")
|
|
||||||
self.browser.set_all_readonly(False)
|
|
||||||
self.browser.controls.append(ClientForm.TextControl('text', 'AJAXREQUEST', {'value': 'accountsel_form:accountsel_region'}))
|
|
||||||
self.browser.controls.append(ClientForm.TextControl('text', id, {'value': id}))
|
|
||||||
self.browser.submit(nologin=True)
|
|
||||||
|
|
||||||
def postpredown(self, id):
|
def postpredown(self, id):
|
||||||
self.browser.select_form("statements_form")
|
self.browser.select_form("statements_form")
|
||||||
self.browser.set_all_readonly(False)
|
self.browser.set_all_readonly(False)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue