I'm extracting data from Y!F using yahoo_finance module. A type error:
'Share' object does not support indexing
is occurring.
Any ideas?
import yahoo_finance
from yahoo_finance import Share
class ticker(object):
def __init__(self, symbol):
self.price = symbol.get_price()
self.change = symbol.get_change()
self.volume = symbol.get_volume()
symbol = ['GOOG','AAPL','MSFT']
lenSymbol = len(symbol)
cc = 0
while cc < lenSymbol:
stringSymb = symbol[cc]
symbol = Share(stringSymb) #TypeError occurring here
c = ticker(symbol)
output = ([c.volume, c.price, c.change, c.volume])
print (output)
cc += 1
symbol = ['GOOG', ...]with theShareinstancesymbol = Share(...)...