title: Download a .csv file with Python
body: <p>I am using Python 3.3 on Windows. I am trying to figure out how to download a .csv file from yahoo finance. It is a file for the Historical Prices. </p>
  
  <p>This is the source code where the link is I'm trying to access.</p>
  
  <pre><code>&lt;p&gt;  
   &lt;a href="http://ichart.finance.yahoo.com/table.csv?s=AAPL&amp;amp;d=1&amp;amp;e=1&amp;amp;f=2014&amp;amp;g=d&amp;amp;a=8&amp;amp;b=7&amp;amp;c=1984&amp;amp;ignore=.csv"&gt;
  &lt;img src="http://l.yimg.com/a/i/us/fi/02rd/spread.gif" width="16" height="16" alt="" border="0"&gt;
  &lt;strong&gt;Download to Spreadsheet&lt;/strong&gt;
   &lt;/a&gt;
  &lt;/p&gt; 
  </code></pre>
  
  <p>And here is the code I wrote to do it.</p>
  
  <pre><code>from urllib.request import urlopen
  from bs4 import BeautifulSoup
  
  website = "http://ichart.finance.yahoo.com/table.csv?s=AAPL&amp;amp;d=1&amp;amp;e=1&amp;amp;f=2014&amp;amp;g=d&amp;amp;a=8&amp;amp;b=7&amp;amp;c=1984&amp;amp;ignore=.csv"
  html = urlopen(website)
  soup = BeautifulSoup(html)
  </code></pre>
  
  <p>When I ran the code, I was expecting it to start the download and put it into my downloads folder, but it doesn't do anything. It runs and then stops. No csv file shows up in my downloads. So I think I'm missing something else in this code.</p>