Bug #1747

paypal: IndexError: list index out of range

Added by leto 2 about 2 years ago. Updated about 2 years ago.

Status:Resolved Start:2015-03-04
Priority:Normal Due date:
Assigned to:Christophe Lampin % Done:

100%

Category:Application / boobank Spent time: -
Target version:1.1
Module:paypal Branch:

Description

boobank -d -b paypal
2015-03-04 16:43:17,189:DEBUG:root:1.1:yamlconfig.py:60:load Loading application configuration file: /home/leto/.config/weboob/boobank.storage.
2015-03-04 16:43:17,190:DEBUG:root:1.1:yamlconfig.py:64:load Application configuration file loaded: /home/leto/.config/weboob/boobank.storage.
2015-03-04 16:43:17,230:DEBUG:modules:1.1:modules.py:161:load_module Loaded module "paypal" from /home/leto/weboob/modules/paypal
2015-03-04 16:43:17,230:DEBUG:backend:1.1:modules.py:98:create_instance Created backend "paypal" for module "paypal" 
Welcome to boobank v1.1

Copyright(C) 2010-2015 Romain Bignon, Christophe Benz
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Type "help" to display available commands.

Loaded backends: paypal

boobank> ls
                 Account                     Balance    Coming 
------------------------------------------+----------+----------
2015-03-04 16:43:18,842:DEBUG:bcall:1.1:bcall.py:81:backend_process <Backend 'paypal'>: Calling function <bound method Boobank._do_complete of <weboob.applications.boobank.boobank.Boobank object at 0x7f2afd28bbd0>>
2015-03-04 16:43:19,290:DEBUG:backend.paypal.browser:1.1:browser.py:405:lowsslcheck Found b8f6c76050ed3035aab08474b1da0ff783f20d114b1740e8db275fe433ff69af as certificate hash
2015-03-04 16:43:20,757:DEBUG:backend.paypal.browser:1.1:browser.py:664:get_page [user_id=************************] Went on https://www.paypal.com/en/cgi-bin/webscr?cmd=_login-run
2015-03-04 16:43:20,781:DEBUG:backend.paypal.browser:1.1:browser.py:685:_change_location !! Relogin !!
2015-03-04 16:43:23,759:DEBUG:backend.paypal.browser:1.1:browser.py:664:get_page [user_id=************************] Went on https://www.paypal.com/fr/cgi-bin/webscr?cmd=_login-processing&login_cmd=_login-done&login_access=**********
2015-03-04 16:43:26,615:DEBUG:backend.paypal.browser:1.1:browser.py:664:get_page [user_id=************************] Went on https://www.paypal.com/myaccount/
2015-03-04 16:43:33,645:DEBUG:backend.paypal.browser:1.1:browser.py:664:get_page [user_id=************************] Went on https://www.paypal.com/myaccount/
2015-03-04 16:43:35,371:DEBUG:backend.paypal.browser:1.1:browser.py:664:get_page [user_id=************************] Went on https://www.paypal.com/en/cgi-bin/webscr?cmd=_login-run
2015-03-04 16:43:38,903:DEBUG:backend.paypal.browser:1.1:browser.py:664:get_page [user_id=************************] Went on https://www.paypal.com/businessexp/money
2015-03-04 16:43:38,907:DEBUG:bcall:1.1:bcall.py:90:backend_process <Backend 'paypal'>: Called function <bound method Boobank._do_complete of <weboob.applications.boobank.boobank.Boobank object at 0x7f2afd28bbd0>> returned: <generator object _do_complete_iter at 0x7f2afa0dd500>
 #1 (paypal)     ************************       0.00  
------------------------------------------+----------+----------
                                    Total       0.00       0.00
boobank> history 1
 Date         Category     Label                                                  Amount 
------------+------------+---------------------------------------------------+-----------
2015-03-04 16:43:42,764:DEBUG:bcall:1.1:bcall.py:81:backend_process <Backend 'paypal'>: Calling function <bound method Boobank._do_complete of <weboob.applications.boobank.boobank.Boobank object at 0x7f2afd28bbd0>>
2015-03-04 16:43:42,765:DEBUG:bcall:1.1:bcall.py:90:backend_process <Backend 'paypal'>: Called function <bound method Boobank._do_complete of <weboob.applications.boobank.boobank.Boobank object at 0x7f2afd28bbd0>> returned: <generator object _do_complete_iter at 0x7f2afcc83cd0>
2015-03-04 16:43:43,782:DEBUG:backend.paypal.browser:1.1:browser.py:664:get_page [user_id=************************] Went on https://www.paypal.com/myaccount/activity/filter?typeFilter=all&isNewSearch=true&startDate=04/12/2014&endDate=04/03/2015&limit=9999
2015-03-04 16:43:46,521:DEBUG:backend.paypal.browser:1.1:browser.py:664:get_page [user_id=************************] Went on https://history.paypal.com/cgi-bin/webscr?cmd=_history-details-from-hub&id=**********
Bug(paypal): list index out of range
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/weboob-1.1-py2.7.egg/weboob/core/bcall.py", line 95, in backend_process
    for subresult in result:
  File "/usr/local/lib/python2.7/dist-packages/weboob-1.1-py2.7.egg/weboob/tools/application/base.py", line 287, in _do_complete_iter
    for i, sub in enumerate(res):
  File "/home/leto/weboob/modules/paypal/module.py", line 59, in iter_history
    for history in self.browser.get_download_history(account):
  File "/home/leto/weboob/modules/paypal/browser.py", line 160, in get_download_history
    fetch_fn=fetch_fn):
  File "/home/leto/weboob/modules/paypal/browser.py", line 181, in smart_fetch
    for trans in chunk:
  File "/home/leto/weboob/modules/paypal/newpages.py", line 88, in iter_transactions
    for trans in self.parse(account):
  File "/home/leto/weboob/modules/paypal/newpages.py", line 97, in parse
    tran = self.parse_transaction(t, account)
  File "/home/leto/weboob/modules/paypal/newpages.py", line 112, in parse_transaction
    transaction = self.browser.convert_amount(account, transaction)
  File "/home/leto/weboob/modules/paypal/browser.py", line 224, in convert_amount
    cc = self.page.get_converted_amount(account)
  File "/home/leto/weboob/modules/paypal/pages.py", line 374, in get_converted_amount
    convert_td = self.document.xpath('//td[contains(text(),"' + account.currency + ')")]')[0].text
IndexError: list index out of range

History

Updated by Christophe Lampin about 2 years ago

  • Assigned to changed from Romain Bignon to Christophe Lampin

My mistake.

Have you some transactions in foreign currencies (like USD) ? Is-it possible to have an anonymous extract of the details page ? (this one : https://history.paypal.com/cgi-bin/webscr?cmd=_history-details-from-hub&id=********** )

Anyway, i will submit a patch tonight to solve this bug.

Updated by Christophe Lampin about 2 years ago

  • Status changed from New to To merge
  • Target version set to 1.1
  • % Done changed from 0 to 100

Updated by Christophe Lampin about 2 years ago

  • Status changed from To merge to Resolved

Also available in: Atom PDF