title: How to get the yahoo finance csv directly into python
body: <p>Does anybody know how to get yahoo finance csv directly into python?</p>
  
  <p>The problem is that when i try to get the data with this (example) link:</p>
  
  <pre><code>http://real-chart.finance.yahoo.com/table.csv?s=WU&amp;a=4&amp;b=20&amp;c=2015&amp;d=05&amp;e=21&amp;f=2016&amp;g=d&amp;ignore=.csv'
  </code></pre>
  
  <p>It gives a pop-up asking if i want to download the csv-file. This causes it to bugg when i try to read it in to python. My scripts is:</p>
  
  <pre><code>today = datetime.date.today()
  
  def get_url(stock='GOOG', START_date = str(int(str(today).split('-')[0])-1)+
              '-' +str(int(str(today).split('-')[1])-1) + ('-') +
              str(int(str(today).split('-')[2])-1), END_date= str(today)):
      baseurl = 'http://real-chart.finance.yahoo.com/table.csv?'
      stock = 's=WU'
  
      FROM_date = ('&amp;a=' + START_date.split('-')[1] + '&amp;b=' +
      START_date.split('-')[2] + '&amp;c=' +
      START_date.split('-')[0])
  
      TO_date = ('&amp;d=' + END_date.split('-')[1] + '&amp;e=' +
      END_date.split('-')[2] + '&amp;f=' + END_date.split('-')[0])
  
      url = baseurl + stock + FROM_date + TO_date + '&amp;g=d&amp;ignore=.csv'
      return url
  
  rawdate = []
  with open(get_url()) as csvfile:
      reader = csv.reader(csvfile, delimiter = ",")
      for row in reader:
          rawdata.append(row)
  </code></pre>
  
  <p>If i download the csv first i can read it into python, but I want to get to access the csv file directly without having to download it first. Is this possible? alternatively have the csv as temp.</p>
  
  <p>Thanks!</p>