Do not crash if the subscription is closed
This commit is contained in:
parent
a64ae7ddfe
commit
6820826e3a
1 changed files with 5 additions and 3 deletions
|
|
@ -116,9 +116,11 @@ class Leclercmobile(BaseBrowser):
|
|||
if not self.is_on_page(HistoryPage):
|
||||
self.location(self.conso)
|
||||
response = self.openurl(self.bills + "0")
|
||||
pdf = PdfPage(StringIO.StringIO(response.read()))
|
||||
for detail in pdf.get_details():
|
||||
yield detail
|
||||
mimetype = response.info().get('Content-Type', '').split(';')[0]
|
||||
if mimetype == "application/pdf":
|
||||
pdf = PdfPage(StringIO.StringIO(response.read()))
|
||||
for detail in pdf.get_details():
|
||||
yield detail
|
||||
|
||||
def iter_bills(self, parentid):
|
||||
if not self.is_on_page(HistoryPage):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue