amazon bills
This commit is contained in:
parent
36c001474c
commit
583923622b
3 changed files with 56 additions and 1 deletions
|
|
@ -111,8 +111,16 @@ class OrderNewPage(OrderPage):
|
|||
order.discount = self.discount()
|
||||
order.shipping = self.shipping()
|
||||
order.total = self.grand_total()
|
||||
order._bill = self.bill()
|
||||
return order
|
||||
|
||||
def bill(self):
|
||||
pdf = self.doc.xpath(u'//a[contains(text(), "Imprimer une facture")]')
|
||||
htlm = self.doc.xpath(u'//a[contains(text(), "Imprimer un récapitulatif de commande")]')
|
||||
format = u'pdf' if pdf else u'html'
|
||||
url = pdf[0].attrib['href'] if pdf else htlm[0].attrib['href']
|
||||
return {'url': url, 'format': format}
|
||||
|
||||
def order_date(self):
|
||||
return datetime.strptime(
|
||||
re.match(u'.*Commandé le ([0-9]+ [0-9]+ [0-9]+) .*',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue