Merge pull request #2 from ausmal/master
Fix issue with historical quotes for mutual funds
This commit is contained in:
commit
518692c69f
|
@ -48,7 +48,7 @@ class Stock:
|
||||||
)
|
)
|
||||||
except:
|
except:
|
||||||
raise NetworkError()
|
raise NetworkError()
|
||||||
if r.status_code is 302:
|
if r.status_code == 302:
|
||||||
raise StockDoesNotExistError(ticker)
|
raise StockDoesNotExistError(ticker)
|
||||||
try:
|
try:
|
||||||
soup = bs(r.text, features="lxml")
|
soup = bs(r.text, features="lxml")
|
||||||
|
@ -70,7 +70,9 @@ class Stock:
|
||||||
"adjusted_close": float(
|
"adjusted_close": float(
|
||||||
row[5].span.string.replace(",", "")
|
row[5].span.string.replace(",", "")
|
||||||
),
|
),
|
||||||
"volume": int(row[6].span.string.replace(",", "")),
|
"volume": int(row[6].span.string.replace(",", ""))
|
||||||
|
if row[6].string != "-"
|
||||||
|
else None,
|
||||||
}
|
}
|
||||||
except:
|
except:
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Reference in New Issue
Block a user