fix crash
This commit is contained in:
parent
e8dd52221e
commit
adebedc450
1 changed files with 3 additions and 1 deletions
|
|
@ -166,6 +166,7 @@ class AccountHistory(BasePage):
|
||||||
|
|
||||||
|
|
||||||
def _iter_transactions(self, doc, coming):
|
def _iter_transactions(self, doc, coming):
|
||||||
|
t = None
|
||||||
for i, tr in enumerate(self.parser.select(doc.getroot(), 'tr')):
|
for i, tr in enumerate(self.parser.select(doc.getroot(), 'tr')):
|
||||||
try:
|
try:
|
||||||
raw = tr.attrib['title'].strip()
|
raw = tr.attrib['title'].strip()
|
||||||
|
|
@ -177,7 +178,8 @@ class AccountHistory(BasePage):
|
||||||
m = re.search('(\d+)/(\d+)', raw)
|
m = re.search('(\d+)/(\d+)', raw)
|
||||||
if not m:
|
if not m:
|
||||||
continue
|
continue
|
||||||
date = t.date.replace(day=int(m.group(1)), month=int(m.group(2)))
|
date = t.date if t else datetime.date.today()
|
||||||
|
date = date.replace(day=int(m.group(1)), month=int(m.group(2)))
|
||||||
if date <= datetime.date.today():
|
if date <= datetime.date.today():
|
||||||
coming = False
|
coming = False
|
||||||
continue
|
continue
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue