From aabd8a2f2af3ad64c06879e9e8b50b103bc8be5e Mon Sep 17 00:00:00 2001 From: Florent Date: Mon, 23 Apr 2012 11:16:43 +0200 Subject: [PATCH] Fix freemobile history pages (site change) --- modules/freemobile/pages/history.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/freemobile/pages/history.py b/modules/freemobile/pages/history.py index a5ef80ca..d22481a8 100644 --- a/modules/freemobile/pages/history.py +++ b/modules/freemobile/pages/history.py @@ -54,12 +54,14 @@ class DetailsPage(BasePage): self.parse_div(divint, u"Appels émis : %s | Appels reçus : %s", True) for trbill in self.document.xpath('//tr[@class="derniereFacture"]'): - mydate = trbill.find('td/input').attrib['onclick'].split("'")[1] + mydate = unicode(trbill.find('td').text.split(":")[1].strip()) bill = Bill() - bill.label = mydate - bill.id = num + "." + mydate - bill.date = date(int(mydate[0:4]), int(mydate[4:6]), int(mydate[6:8])) - bill.format = 'html' + bill.label = unicode(mydate) + billid = mydate.replace('-', '') + billid = billid[4:8] + billid[2:4] + billid[0:2] + bill.id = num + "." + billid + bill.date = date(*reversed([int(x) for x in mydate.split("-")])) + bill.format = u'html' self.datebills.append(bill) def parse_div(self, divglobal, string, inter=False):