(creditcooperatif) obsolete URLs (error : "AttributeError: 'NoneType' object has no attribute 'login'")
Note: for a clearer description, I have put the code blocks at the end of the issue.
I am new to weboob, and have successfully used the "caissedepargne" backend with a command line such as :
boobank history XXXXXXXXXXX@caissedepargne -f ofx -O output.ofx -n 10000
to retrieve my banking history.
When trying the same kind of line with the "creditcooperatif" backend I have the output [1] (using the --debug
option).
It seems to me that the issue is that the URLs are not the one used as of today by the bank (see the redirection).
I have tried changing the loginpage URL in the module code (in ~/.local/share/weboob/modules/1.2/creditcooperatif/perso/browser.py
) from '/portail//particuliers/login.do' to '/Particuliers' to match with the website of the bank as of today, but get the [2] output when running the command line again.
My guess is that the website now relying quite heavily on javascript prevent weboob from finding the authentication form. However I have not dived into weboob code far enough to understand how pages are handled and how javascript in particular is managed (I guess this is not the first website handled by weboob using javascript).
Additional info :
- boobank version : v1.2
- operating system : Debian GNU/Linux 9 (Debian Stable)
- login page for the bank : https://www.credit-cooperatif.coop/Particuliers
- javascript part which seems relevant to me : [3]
- there is also a whole script which seems to manage the auth session below this part, but at the moment I do not paste it, for the sake of clarity of this issue report
Code blocks
[1]
2018-11-10 08:30:41,582:DEBUG:root:1.2:yamlconfig.py:60:load Loading application configuration file: /media/home_hdd/bher/.config/weboob/boobank.storage. 2018-11-10 08:30:41,583:DEBUG:root:1.2:yamlconfig.py:64:load Application configuration file loaded: /media/home_hdd/bher/.config/weboob/boobank.storage. 2018-11-10 08:30:41,657:DEBUG:modules:1.2:modules.py:162:load_module Loaded module "caissedepargne" from /media/home_hdd/bher/.local/share/weboob/modules/1.2/caissedepargne 2018-11-10 08:30:42,373:DEBUG:backend:1.2:modules.py:93:create_instance Created backend "caissedepargne" for module "caissedepargne" 2018-11-10 08:30:42,425:DEBUG:modules:1.2:modules.py:162:load_module Loaded module "creditcooperatif" from /media/home_hdd/bher/.local/share/weboob/modules/1.2/creditcooperatif 2018-11-10 08:30:43,142:DEBUG:backend:1.2:modules.py:93:create_instance Created backend "creditcooperatif" for module "creditcooperatif" 2018-11-10 08:30:43,163:DEBUG:bcall:1.2:bcall.py:91:backend_process <Backend 'creditcooperatif'>: Calling function <bound method Boobank._do_complete of <weboob.applications.boobank.boobank.Boobank object at 0x7f835ce9b1d0>> 2018-11-10 08:30:43,168:DEBUG:requests.packages.urllib3.util.retry:1.2:retry.py:191:from_int Converted retries value: 2 -> Retry(total=2, connect=None, read=None, redirect=None) 2018-11-10 08:30:43,169:DEBUG:requests.packages.urllib3.util.retry:1.2:retry.py:191:from_int Converted retries value: 2 -> Retry(total=2, connect=None, read=None, redirect=None) 2018-11-10 08:30:43,176:DEBUG:requests.packages.urllib3.connectionpool:1.2:connectionpool.py:811:_new_conn Starting new HTTPS connection (1): www.credit-cooperatif.coop 2018-11-10 08:30:43,515:DEBUG:requests.packages.urllib3.connectionpool:1.2:connectionpool.py:400:_make_request https://www.credit-cooperatif.coop:443 "GET /portail//particuliers/login.do HTTP/1.1" 301 184 2018-11-10 08:30:43,587:DEBUG:requests.packages.urllib3.connectionpool:1.2:connectionpool.py:400:_make_request https://www.credit-cooperatif.coop:443 "GET / HTTP/1.1" 302 201 2018-11-10 08:30:43,678:DEBUG:requests.packages.urllib3.connectionpool:1.2:connectionpool.py:400:_make_request https://www.credit-cooperatif.coop:443 "GET /Institutionnel HTTP/1.1" 200 None 2018-11-10 08:30:43,754:DEBUG:backend.creditcooperatif.browser:1.2:browsers.py:679:internal_callback Unable to handle https://www.credit-cooperatif.coop/Institutionnel 2018-11-10 08:30:43,755:DEBUG:bcall:1.2:bcall.py:97:backend_process <Backend 'creditcooperatif'>: Called function <bound method Boobank._do_complete of <weboob.applications.boobank.boobank.Boobank object at 0x7f835ce9b1d0>> raised an error: AttributeError("'NoneType' object has no attribute 'login'",) Bug(creditcooperatif): 'NoneType' object has no attribute 'login' 2018-11-10 08:30:43,766:DEBUG:requests.packages.urllib3.util.retry:1.2:retry.py:191:from_int Converted retries value: 2 -> Retry(total=2, connect=None, read=None, redirect=None) 2018-11-10 08:30:43,766:DEBUG:requests.packages.urllib3.util.retry:1.2:retry.py:191:from_int Converted retries value: 2 -> Retry(total=2, connect=None, read=None, redirect=None) === [ 0%] Getting http://updates.weboob.org/1.2/main/ 2018-11-10 08:30:43,771:DEBUG:requests.packages.urllib3.connectionpool:1.2:connectionpool.py:212:_new_conn Starting new HTTP connection (1): updates.weboob.org 2018-11-10 08:30:43,877:DEBUG:requests.packages.urllib3.connectionpool:1.2:connectionpool.py:400:_make_request http://updates.weboob.org:80 "GET /1.2/main/modules.list HTTP/1.1" 200 48985 Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/weboob/core/bcall.py", line 93, in backend_process result = function(backend, *args, **kwargs) File "/usr/lib/python2.7/dist-packages/weboob/tools/application/base.py", line 298, in _do_complete res = getattr(backend, function)(*args, **kwargs) File "/media/home_hdd/bher/.local/share/weboob/modules/1.2/creditcooperatif/module.py", line 63, in get_account return find_object(self.browser.get_accounts_list(), id=_id, error=AccountNotFound) File "/media/home_hdd/bher/.local/share/weboob/modules/1.2/creditcooperatif/perso/compat/browsers.py", line 755, in inner browser.do_login() File "/media/home_hdd/bher/.local/share/weboob/modules/1.2/creditcooperatif/perso/browser.py", line 68, in do_login self.page.login(self.username, self.password) AttributeError: 'NoneType' object has no attribute 'login'
[2]
2018-11-10 08:30:03,299:DEBUG:root:1.2:yamlconfig.py:60:load Loading application configuration file: /media/home_hdd/bher/.config/weboob/boobank.storage. 2018-11-10 08:30:03,371:DEBUG:root:1.2:yamlconfig.py:64:load Application configuration file loaded: /media/home_hdd/bher/.config/weboob/boobank.storage. 2018-11-10 08:30:03,583:DEBUG:modules:1.2:modules.py:162:load_module Loaded module "caissedepargne" from /media/home_hdd/bher/.local/share/weboob/modules/1.2/caissedepargne 2018-11-10 08:30:04,352:DEBUG:backend:1.2:modules.py:93:create_instance Created backend "caissedepargne" for module "caissedepargne" 2018-11-10 08:30:04,444:DEBUG:modules:1.2:modules.py:162:load_module Loaded module "creditcooperatif" from /media/home_hdd/bher/.local/share/weboob/modules/1.2/creditcooperatif 2018-11-10 08:30:05,184:DEBUG:backend:1.2:modules.py:93:create_instance Created backend "creditcooperatif" for module "creditcooperatif" 2018-11-10 08:30:05,205:DEBUG:bcall:1.2:bcall.py:91:backend_process <Backend 'creditcooperatif'>: Calling function <bound method Boobank._do_complete of <weboob.applications.boobank.boobank.Boobank object at 0x7efce06d61d0>> 2018-11-10 08:30:05,209:DEBUG:requests.packages.urllib3.util.retry:1.2:retry.py:191:from_int Converted retries value: 2 -> Retry(total=2, connect=None, read=None, redirect=None) 2018-11-10 08:30:05,209:DEBUG:requests.packages.urllib3.util.retry:1.2:retry.py:191:from_int Converted retries value: 2 -> Retry(total=2, connect=None, read=None, redirect=None) 2018-11-10 08:30:05,222:DEBUG:requests.packages.urllib3.connectionpool:1.2:connectionpool.py:811:_new_conn Starting new HTTPS connection (1): www.credit-cooperatif.coop 2018-11-10 08:30:05,591:DEBUG:requests.packages.urllib3.connectionpool:1.2:connectionpool.py:400:_make_request https://www.credit-cooperatif.coop:443 "GET /Particuliers HTTP/1.1" 200 None 2018-11-10 08:30:05,785:DEBUG:backend.creditcooperatif.browser:1.2:browsers.py:664:internal_callback Handle https://www.credit-cooperatif.coop/Particuliers with LoginPage 2018-11-10 08:30:05,786:DEBUG:bcall:1.2:bcall.py:97:backend_process <Backend 'creditcooperatif'>: Called function <bound method Boobank._do_complete of <weboob.applications.boobank.boobank.Boobank object at 0x7efce06d61d0>> raised an error: FormNotFound() Bug(creditcooperatif): 2018-11-10 08:30:05,908:DEBUG:requests.packages.urllib3.util.retry:1.2:retry.py:191:from_int Converted retries value: 2 -> Retry(total=2, connect=None, read=None, redirect=None) 2018-11-10 08:30:05,909:DEBUG:requests.packages.urllib3.util.retry:1.2:retry.py:191:from_int Converted retries value: 2 -> Retry(total=2, connect=None, read=None, redirect=None) === [ 0%] Getting http://updates.weboob.org/1.2/main/ 2018-11-10 08:30:05,916:DEBUG:requests.packages.urllib3.connectionpool:1.2:connectionpool.py:212:_new_conn Starting new HTTP connection (1): updates.weboob.org 2018-11-10 08:30:06,089:DEBUG:requests.packages.urllib3.connectionpool:1.2:connectionpool.py:400:_make_request http://updates.weboob.org:80 "GET /1.2/main/modules.list HTTP/1.1" 200 48985 Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/weboob/core/bcall.py", line 93, in backend_process result = function(backend, *args, **kwargs) File "/usr/lib/python2.7/dist-packages/weboob/tools/application/base.py", line 298, in _do_complete res = getattr(backend, function)(*args, **kwargs) File "/media/home_hdd/bher/.local/share/weboob/modules/1.2/creditcooperatif/module.py", line 63, in get_account return find_object(self.browser.get_accounts_list(), id=_id, error=AccountNotFound) File "/media/home_hdd/bher/.local/share/weboob/modules/1.2/creditcooperatif/perso/compat/browsers.py", line 755, in inner browser.do_login() File "/media/home_hdd/bher/.local/share/weboob/modules/1.2/creditcooperatif/perso/browser.py", line 68, in do_login self.page.login(self.username, self.password) File "/media/home_hdd/bher/.local/share/weboob/modules/1.2/creditcooperatif/perso/pages.py", line 37, in login form = self.get_form(xpath='//form[@id="AuthForm"]') File "/media/home_hdd/bher/.local/share/weboob/modules/1.2/creditcooperatif/perso/compat/pages.py", line 693, in get_form raise FormNotFound() FormNotFound
[3]
`