From cdc8c4e59b9b41ab73e0ad5cd3cec96690e60c6b Mon Sep 17 00:00:00 2001 From: Vincent A Date: Sun, 14 Apr 2019 15:56:25 +0200 Subject: [PATCH] [bolden] retype lend documents and add fiscal docs --- modules/bolden/browser.py | 6 +++++- modules/bolden/module.py | 1 - modules/bolden/pages.py | 19 +++++++++++++++++-- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/modules/bolden/browser.py b/modules/bolden/browser.py index aac62cf91d..853571165a 100644 --- a/modules/bolden/browser.py +++ b/modules/bolden/browser.py @@ -97,6 +97,10 @@ def iter_documents(self): doc.id = inv.id doc.url = inv._docurl doc.label = 'Contrat %s' % inv.label - doc.type = DocumentTypes.OTHER + doc.type = DocumentTypes.CONTRACT doc.format = 'pdf' yield doc + + self.profile.go() + for doc in self.page.iter_documents(): + yield doc diff --git a/modules/bolden/module.py b/modules/bolden/module.py index 8ecbaa463f..c0e8ce980b 100644 --- a/modules/bolden/module.py +++ b/modules/bolden/module.py @@ -19,7 +19,6 @@ from __future__ import unicode_literals - from weboob.tools.backend import Module, BackendConfig from weboob.tools.value import ValueBackendPassword from weboob.capabilities.bank import CapBankWealth, Account diff --git a/modules/bolden/pages.py b/modules/bolden/pages.py index a9db44b4ce..79193b67e5 100644 --- a/modules/bolden/pages.py +++ b/modules/bolden/pages.py @@ -20,14 +20,15 @@ from __future__ import unicode_literals from weboob.browser.elements import ListElement, ItemElement, method, TableElement -from weboob.browser.filters.html import TableCell, Link, Attr +from weboob.browser.filters.html import TableCell, Link, Attr, AbsoluteLink from weboob.browser.filters.standard import ( - CleanText, CleanDecimal, Slugify, Date, Field, Format, + CleanText, CleanDecimal, Slugify, Date, Field, Format, Regexp, ) from weboob.browser.pages import HTMLPage, LoggedPage from weboob.capabilities.base import NotAvailable from weboob.capabilities.bank import Account, Transaction, Investment from weboob.capabilities.profile import Profile +from weboob.capabilities.bill import Document, DocumentTypes from weboob.exceptions import BrowserIncorrectPassword from weboob.tools.compat import urljoin @@ -143,3 +144,17 @@ class get_profile(ItemElement): Attr('//input[@id="SubModel_Address_City"]', 'value'), CleanText('//select[@id="SubModel_Address_Country"]/option[@selected]'), ) + + @method + class iter_documents(ListElement): + item_xpath = '//a[starts-with(@href, "/Upload/Show")]' + + class item(ItemElement): + klass = Document + + obj_label = 'Imprimé fiscal unique' + obj_type = DocumentTypes.REPORT + obj_format = 'pdf' + + obj_url = AbsoluteLink('.') + obj_id = Regexp(Field('url'), r'fileId=(\d+)') -- GitLab