Bug #1764

[amazon] Support a new payment method layout

Added by Oleg Plakhotniuk almost 3 years ago. Updated over 2 years ago.

Status:Resolved Start:2015-03-13
Priority:Normal Due date:
Assigned to:Oleg Plakhotniuk % Done:

100%

Category:Modules Spent time: -
Target version:1.1
Module:amazon Branch:

Description

Currently it throws an exception when trying to parse this kind of payment:

/srv/pub/projects/weboob/repo/modules/amazon/pages.py in payments(self)
    123                 yield t
    124         else:
--> 125             for method in self.paymethods():
    126                 pmt = Payment()
    127                 pmt.date = self.order_date()

/srv/pub/projects/weboob/repo/modules/amazon/pages.py in paymethods(self)
    133     def paymethods(self):
    134         for root in self.doc.xpath('//h5[contains(text(),"Payment Method")]'):
--> 135             alt = root.xpath('../div/img/@alt')[0]
    136             span = root.xpath('../div/span/text()')[0]
    137             digits = re.match(r'[^0-9]*([0-9]+)[^0-9]*', span).group(1)

IndexError: list index out of range

Associated revisions

Revision ce65d350819bab79ef438fb7fe5086de469fe67c
Added by Oleg Plakhotniuk almost 3 years ago

[amazon] Support for a new payment layout and priceless items. Fixes #1764

History

Updated by Oleg Plakhotniuk almost 3 years ago

  • Status changed from In progress to To merge
  • % Done changed from 50 to 100

Also there might be items w/o price in an order, for example when Amazon resends lost package. Added support for these as well.

Done in branch issue1764

Updated by Oleg Plakhotniuk almost 3 years ago

  • Status changed from To merge to Resolved

Updated by Romain Bignon over 2 years ago

  • Target version set to 1.1

Also available in: Atom PDF