Open helhadry opened 7 years ago
i try to use google finance for importing stock price but i have this problem (work with python 2.x) :+1: the json object must be str not 'bytes'
def get_value(identifier): get_value_url = 'http://finance.google.com/finance/info?client=ig&q=' + identifier value = subprocess.Popen(['curl', '-s', get_value_url], stdout=subprocess.PIPE).communicate()[0] j = json.loads(value[5:len(value)-2]) return float(j['l'])
from googlefinance import getQuotes import json print(getQuotes('AAPL')[0]['LastTradePrice'])
i try to use google finance for importing stock price but i have this problem (work with python 2.x) :+1:
the json object must be str not 'bytes'
def get_value(identifier): get_value_url = 'http://finance.google.com/finance/info?client=ig&q=' + identifier value = subprocess.Popen(['curl', '-s', get_value_url], stdout=subprocess.PIPE).communicate()[0] j = json.loads(value[5:len(value)-2]) return float(j['l'])