hist_url = (
    'http://real-chart.finance.yahoo.com/table.csv?s=XLV&a=4&b=23&c=2016&g=d&ignore.csv'
    )
realtime_url = (
    'http://download.finance.yahoo.com/d/quotes.csv?s=XLV&f=p&e=.csv')
eastern = pytz.timezone('US/Eastern')
while True:
    stock = Share('XLV')
a = stock.get_historical('2016-05-23', '2016-05-23')[0]['Close']
b = stock.get_prev_close()
r = requests.get(hist_url)
reader = csv.DictReader(r.iter_lines())
c = float(next(reader)['Close'])
d = float(requests.get(realtime_url).text)
print(datetime.datetime.now(eastern).time(), a, b, c, d)
time.sleep(120)
Incorrect close data from yahoo_finance in python