The new woob repository is here: https://gitlab.com/woob/woob. This gitlab will be removed soon.

Commit 4b99e8c3 authored by Ilyas Semmaoui's avatar Ilyas Semmaoui Committed by Vincent A

[amazon] Handle unavailable invoices

parent 78ab37de
......@@ -254,10 +254,13 @@ def obj_url(self):
url = Coalesce(
Link('//a[contains(@href, "download")]|//a[contains(@href, "generated_invoices")]', default=NotAvailable),
Link('//a[contains(text(), "Récapitulatif de commande")]', default=NotAvailable),
default=NotAvailable
)(async_page.doc)
return url
def obj_format(self):
if not Field('url')(self):
return NotAvailable
if 'summary' in Field('url')(self):
return 'html'
return 'pdf'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment