From 4ed53b5de90c96f055c8089e18970dae0ee3f0eb Mon Sep 17 00:00:00 2001 From: Laurent Bachelier Date: Tue, 12 Feb 2013 16:54:09 +0100 Subject: [PATCH] paypal: Ignore "empty" rows --- modules/paypal/pages.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/paypal/pages.py b/modules/paypal/pages.py index b183ad23..796da567 100644 --- a/modules/paypal/pages.py +++ b/modules/paypal/pages.py @@ -262,6 +262,9 @@ class HistoryPage(BasePage): 'September', 'October', 'November', 'December'] date_format, time_format, months = self.guess_format() for row in self.document.xpath('//table[@id="transactionTable"]/tbody/tr'): + if row.xpath('.//td') < 5: + continue + amount = row.xpath('.//td[@headers="gross"]')[-1].text_content().strip() if re.search('\d', amount): currency = Account.get_currency(amount)