Skip to content

Commit

Permalink
better error handling for price band attr (dirty patch for #5)
Browse files Browse the repository at this point in the history
  • Loading branch information
sdabhi23 committed Jul 16, 2019
1 parent 8cfda0d commit 576b265
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bsedata/quote.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ def quote(scripCode):
except KeyError:
try:
if span['id'] == 'lblPBdate':
res['priceBand'] = span.string.split(':')[1].strip()
try:
res['priceBand'] = span.string.split(':')[1].strip()
except AttributeError:
res['priceBand'] = ''
elif span['id'] == 'strongDate':
res['updatedOn'] = span.string.split('-')[1].strip()
except KeyError:
Expand Down

0 comments on commit 576b265

Please sign in to comment.