title: Python Get Stock Prices
body: <p>I am working on a tutorial to pull different stock prices from Yahoo Fiances. I have this code which works but prints out the sentence the price of the different stock symbols and then the array brackets but not the prices. All help greatly appreciated.</p>
  
  <pre><code>import urllib
  import re
  
  symbolslist = ["aapl", "spy", "goog", "nflx"]
  
  i = 0
  while i &lt; len(symbolslist):
      url = "http://finance.yahoo.com/q?s=" + symbolslist[i] + "&amp;ql=1" 
      htmlfile = urllib.urlopen(url)
      htmltext = htmlfile.read()
      regex = '&lt;span id="yfs_l84_' + symbolslist[i] + ' "&gt; (.+?) &lt;/span&gt;'
      pattern = re.compile(regex)
      price = re.findall(pattern, htmltext)
      print "the price of ", symbolslist[i], " is ", price
      i += 1
  </code></pre>