I have the following csv url that works correctly if simply pasted into the browser:
http://www.google.com/finance/historical?q=JSE%3AMTN&startdate=Nov 1, 2011&enddate=Nov 30, 2011&output=csv
However, I cannot load csv using pandas. I get an error message:
urllib.error.HTTPERROR: HTTP ERROR 400: Bad Request
the code:
import pandas as pd
def main():
url = 'http://www.google.com/finance/historical?q=JSE%3AMTN&startdate=Nov 1, 2011&enddate=Nov 30, 2011&output=csv'
df = pd.read_csv(url)
print(df)
Please can someone point me in the right direction.
source
share