You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Google's mechanism to report mutual funds is a bit different, and the way it returns data sometimes has a ',}' that causes the json parser to hit an exception. Also, the keys are different from non-mutual funds. I used the hackery below to get past it, but you may want to do something more elegant:
try:
jayson = r.text.replace('\n', '')
# mutual funds have a ,} that messes up the json parser
jayson = jayson.replace(',}','}')
jayson = json.loads(jayson[2:])[0]
self.ticker = jayson['t']
except:
self.ticker = None
Google's mechanism to report mutual funds is a bit different, and the way it returns data sometimes has a ',}' that causes the json parser to hit an exception. Also, the keys are different from non-mutual funds. I used the hackery below to get past it, but you may want to do something more elegant:
try:
jayson = r.text.replace('\n', '')
# mutual funds have a ,} that messes up the json parser
jayson = jayson.replace(',}','}')
jayson = json.loads(jayson[2:])[0]
self.ticker = jayson['t']
except:
self.ticker = None
The text was updated successfully, but these errors were encountered: