From 0cbd3dee6ed944a85e05ecd183bd38af1ec2278a Mon Sep 17 00:00:00 2001 From: Laurent Bachelier Date: Mon, 4 Feb 2013 18:23:01 +0100 Subject: [PATCH] paypal: Fix balance parsing with a single currency account --- modules/paypal/pages.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/paypal/pages.py b/modules/paypal/pages.py index 5879ddc4..31ee3f92 100644 --- a/modules/paypal/pages.py +++ b/modules/paypal/pages.py @@ -49,7 +49,10 @@ class AccountPage(BasePage): # Total currency balance. # If there are multiple currencies, this balance is all currencies # converted to the main currency. - balance = content.xpath('.//h3/span[@class="balance"]')[0].text_content().strip() + balance = content.xpath('.//h3/span[@class="balance"]') + if not balance: + balance = content.xpath('.//li[@class="balance"]//span/strong') + balance = balance[0].text_content().strip() # Primary currency account primary_account = Account()