Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Support
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
weboob
weboob
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 179
    • Issues 179
    • List
    • Boards
    • Labels
    • Milestones
  • Merge Requests 53
    • Merge Requests 53
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • weboob
  • weboobweboob
  • Issues
  • #407

Closed
Open
Opened Jun 11, 2020 by Vincent R@zigma12
  • Report abuse
  • New issue
Report abuse New issue

[boobank][creditmutuel] AttributeError("'list' object has no attribute 'xpath'")

Hello,
this is my first issue reporting, sorry if this is not a bug...

EDIT: I guess my problem has something to do with this commit but this does not help me.

With which module do you encounter problems?

boobank with creditmutuel

Describe the problem you encounter

An error is raised when listing the accounts: AttributeError("'list' object has no attribute 'xpath'")

  • The error is observed sometimes but not everytime when I type boobank list in the terminal. Sorry, the only logic I found is: the bug happens the first time I type the command in the terminal. The 2nd, 3rd etc, things are fine.
  • The error happens everytime I use a python script of mine. The script works well with other bank backends like caissedepargne or banquepopulaire. The script crashes while iterating. E.g.
w = Weboob()  
for account in w.iter_accounts():  
    ...  
    ...  

This problem is specific to creditmutuel. It does not happen with other two I use: banquepopulaire and caissedepargne

Paste here the stacktrace or error message you observe

Below is the result of boobank list when the bug occurs. --auto-update does not help.

Bug(CMMC (Vincent)): 'list' object has no attribute 'xpath'  
(If --auto-update is passed on the command-line, new versions of the module will be checked automatically)
Traceback (most recent call last):
  File "/home/vincent/.local/lib/python3.8/site-packages/weboob/core/bcall.py", line 106, in backend_process
    for subresult in result:
  File "/home/vincent/.local/share/weboob/modules/2.0/creditmutuel/module.py", line 74, in iter_accounts
    for account in self.browser.get_accounts_list():
  File "/home/vincent/.local/lib/python3.8/site-packages/weboob/browser/browsers.py", line 824, in inner
    return func(browser, *args, **kwargs)
  File "/home/vincent/.local/share/weboob/modules/2.0/creditmutuel/browser.py", line 492, in get_accounts_list
    for account in self.page.iter_li_accounts():
  File "/home/vincent/.local/lib/python3.8/site-packages/weboob/browser/elements.py", line 218, in __iter__
    for obj in item:
  File "/home/vincent/.local/lib/python3.8/site-packages/weboob/browser/elements.py", line 360, in __iter__
    self.handle_attr(attr, getattr(self, 'obj_%s' % attr))
  File "/home/vincent/.local/lib/python3.8/site-packages/weboob/browser/elements.py", line 377, in handle_attr
    value = self.use_selector(func, key=key)
  File "/home/vincent/.local/lib/python3.8/site-packages/weboob/browser/elements.py", line 127, in use_selector
    value = func(self)
  File "/home/vincent/.local/lib/python3.8/site-packages/weboob/browser/filters/standard.py", line 858, in __call__
    values = [self.select(selector, item) for selector in self.selector]
  File "/home/vincent/.local/lib/python3.8/site-packages/weboob/browser/filters/standard.py", line 858, in <listcomp>
    values = [self.select(selector, item) for selector in self.selector]
  File "/home/vincent/.local/lib/python3.8/site-packages/weboob/browser/filters/base.py", line 168, in select
    ret = selector(item)
  File "/home/vincent/.local/lib/python3.8/site-packages/weboob/browser/filters/standard.py", line 122, in __call__
    return self.select(self.selector, base)
  File "/home/vincent/.local/lib/python3.8/site-packages/weboob/browser/filters/base.py", line 168, in select
    ret = selector(item)
  File "/home/vincent/.local/lib/python3.8/site-packages/weboob/browser/filters/base.py", line 184, in __call__
    return self.filter(self.select(self.selector, item))
  File "/home/vincent/.local/lib/python3.8/site-packages/weboob/browser/filters/base.py", line 168, in select
    ret = selector(item)
  File "/home/vincent/.local/lib/python3.8/site-packages/weboob/browser/filters/base.py", line 184, in __call__
    return self.filter(self.select(self.selector, item))
  File "/home/vincent/.local/lib/python3.8/site-packages/weboob/browser/filters/base.py", line 164, in select
    ret = item.xpath(selector)
AttributeError: 'list' object has no attribute 'xpath'

What are the steps to reproduce the problem?

The problem generally happens the first time the command is typed in the terminal. The next times, the problem seems not to happen??

What weboob version are you using?

weboob-config v2.0

What module version are you using?

Version 202006090901

How did you install weboob?

pip3 install --user weboob

Additional info you'd like to mention

I recently followed this to solve a problem of ssl security. The command boobank list --nss was fine but I did not know how to use nss within my python code. Not sure this has anything to do with my current problem.

Edited Jun 11, 2020 by Vincent R
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
0
Labels
None
Assign labels
  • View project labels
Reference: weboob/weboob#407