title: Get only the first link of a URLs list with BeautifulSoup
body: <p>I parsed an entire HTML file, extracting some URLs with Beautifulsoup module in Python, with this peace of code:</p>
  
  <pre><code>for link in soup.find_all('a'):
      for line in link :
          if "condition" in line :
  
             print link.get("href")
  </code></pre>
  
  <p>and i get in the shell a series of links that observe the condition in the if loop:</p>
  
  <ul>
  <li>http:// ..link1</li>
  <li>http:// ..link2</li>
  <li>.</li>
  <li>.</li>
  <li>http:// ..linkn</li>
  </ul>
  
  <p>how can i put in a variable "output" only the first link of this list?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>The web page is : <a href="http://download.cyanogenmod.com/?device=p970" rel="nofollow">http://download.cyanogenmod.com/?device=p970</a> , the script have to return the first short URL (http://get.cm/...) in the HTML page.</p>