title: Using beautifulsoup in python to get link names and "selecting" links instead of limiting?
body: <p>I've got the following code trying to return data from some html, however I am unable to return what I require...</p>
  
  <pre><code>import urllib2
  from bs4 import BeautifulSoup
  from time import sleep
  
  def getData():
      htmlfile = open('C:/html.html', 'rb')
      html = htmlfile.read()
      soup = BeautifulSoup(html)
      items = soup.find_all('div', class_="blocks")
      for item in items:
          links = item.find_all('h3')
          for link in links:
              print link
  
  getData()
  </code></pre>
  
  <p>Returns the a list of following:</p>
  
  <pre><code>&lt;h3&gt;
      &lt;a href="http://www.mywebsite.com/titles" title="Click for details(x)"&gt;
      TITLE STUFF HERE (YES)
      &lt;/a&gt;
  &lt;/h3&gt;
  
  &lt;h3&gt;
      &lt;a href="http://www.mywebsite.com/titles" title="Click for details(x)"&gt;
      TITLE STUFF HERE (MAYBE)
      &lt;/a&gt;
  &lt;/h3&gt;
  </code></pre>
  
  <p>I want to be able to return just the title: <code>TITLE STUFF HERE (YES)</code> and <code>TITLE STUFF HERE (MAYBE)</code></p>
  
  <p>Another thing I want to be able to do to use the 
  <code>soup.find_all("a", limit=2)</code> function but instead of "limit" and instead of returning two results only I want it to return ONLY the second link... so a select feature not a limit? (Does such a feature exist?)</p>