From 7b9a2e7cb8166c311257f9550c3f3737cc5226eb Mon Sep 17 00:00:00 2001 From: Ludovic LANGE Date: Sun, 3 Jan 2021 22:51:22 +0100 Subject: [PATCH] [pajemploi] Fix download of payslip --- modules/pajemploi/browser.py | 5 ++++- modules/pajemploi/pages.py | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/pajemploi/browser.py b/modules/pajemploi/browser.py index de99cb560e..fcad6bbf74 100644 --- a/modules/pajemploi/browser.py +++ b/modules/pajemploi/browser.py @@ -126,4 +126,7 @@ def download_document(self, document): and document._need_refresh_previous_page ): document._previous_page.go(data=document._previous_data) - return self.open(document.url).content + data = {} + if hasattr(document, '_ref'): + data["ref"] = document._ref + return self.open(document.url, data=data).content diff --git a/modules/pajemploi/pages.py b/modules/pajemploi/pages.py index 8cf6df3f6a..8c19757117 100644 --- a/modules/pajemploi/pages.py +++ b/modules/pajemploi/pages.py @@ -41,7 +41,7 @@ Field, Eval, ) -from weboob.browser.filters.html import Attr, Link, TableCell +from weboob.browser.filters.html import Attr, Link, TableCell, FormValue from weboob.tools.date import parse_french_date @@ -280,6 +280,7 @@ def iter_documents(self, proto_doc, subscription): bs.type = DocumentTypes.OTHER bs.label = "Bulletin de salaire %s %s" % (subscription.label, date.strftime("%d/%m/%Y")) bs.url = Attr(".", "action")(frm[0]) + bs._ref = FormValue('./input[@id="ref"]')(frm[0]) yield bs # Relevé mensuel -- GitLab