diff --git a/modules/freemobile/browser.py b/modules/freemobile/browser.py index c34ca4b3..c072a2bb 100644 --- a/modules/freemobile/browser.py +++ b/modules/freemobile/browser.py @@ -76,7 +76,7 @@ class Freemobile(BaseBrowser): def get_history(self, subscription): if not self.is_on_page(HistoryPage): - self.location('/moncompte/ajax.php?page=consotel_current_month', 'login=' + self.username) + self.location('/moncompte/ajax.php?page=consotel_current_month', 'login=' + subscription._login) return self.page.get_calls(subscription) def get_details(self, subscription): diff --git a/modules/freemobile/pages/history.py b/modules/freemobile/pages/history.py index fa787f16..1507b0d4 100644 --- a/modules/freemobile/pages/history.py +++ b/modules/freemobile/pages/history.py @@ -111,7 +111,6 @@ class DetailsPage(BasePage): return voice def get_details(self, subscription): - print self.details num = self.details['num' + subscription.id] return self.details[num] diff --git a/modules/freemobile/pages/homepage.py b/modules/freemobile/pages/homepage.py index 3ed46539..b9f7d6a9 100644 --- a/modules/freemobile/pages/homepage.py +++ b/modules/freemobile/pages/homepage.py @@ -30,9 +30,12 @@ class HomePage(BasePage): def get_list(self): l = [] - for divabo in self.document.xpath('//div[@class="idAbonne pointer"]'): + for divglobal in self.document.xpath('//div[@class="abonne"]'): + login = divglobal.xpath('//div[@class="acceuil_btn"]/a')[0].attrib['href'].split('l=')[1] + divabo = divglobal.xpath('div[@class="idAbonne pointer"]')[0] owner = unicode(divabo.xpath('p')[0].text.replace(' - ', '')) phone = unicode(divabo.xpath('p/span')[0].text) + self.browser.logger.debug('Found ' + login + ' as subscription identifier') self.browser.logger.debug('Found ' + owner + ' as subscriber') self.browser.logger.debug('Found ' + phone + ' as phone number') phoneplan = unicode(self.document.xpath('//div[@class="forfaitChoisi"]')[0].text.lstrip().rstrip()) @@ -41,5 +44,6 @@ class HomePage(BasePage): subscription = Subscription(phone) subscription.label = phone + ' - ' + phoneplan subscription.subscriber = owner + subscription._login = login yield subscription