Fix pdf downloading
This commit is contained in:
parent
159e74ac6d
commit
7f290ef512
2 changed files with 9 additions and 3 deletions
|
|
@ -102,6 +102,6 @@ class Freemobile(BaseBrowser):
|
|||
|
||||
def download_bill(self, id):
|
||||
assert isinstance(id, basestring)
|
||||
date = id.split('.')[1]
|
||||
bill = self.get_bill(id)
|
||||
|
||||
return self.readurl('/moncompte/ajax.php?page=facture&mode=html&date=' + date)
|
||||
return self.readurl(bill._url)
|
||||
|
|
|
|||
|
|
@ -61,7 +61,13 @@ class DetailsPage(BasePage):
|
|||
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'
|
||||
alink = trbill.find('td/a')
|
||||
if alink.attrib.get("class") == "linkModal tips":
|
||||
bill.format = u'html'
|
||||
bill._url = alink.attrib.get('data-link')
|
||||
else:
|
||||
bill.format = u"pdf"
|
||||
bill._url = alink.attrib.get('href')
|
||||
self.datebills.append(bill)
|
||||
|
||||
def parse_div(self, divglobal, string, inter=False):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue