title: Extract image links from the webpage using Python
body: <p>So I wanted to get all of the pictures on this page(of the nba teams).
  <a href="http://www.cbssports.com/nba/draft/mock-draft" rel="nofollow">http://www.cbssports.com/nba/draft/mock-draft</a></p>
  
  <p>However, my code gives a bit more than that. It gives me,</p>
  
  <pre><code>&lt;a href="/nba/teams/page/ORL"&gt;&lt;img src="http://sports.cbsimg.net/images/nba/logos/30x30/ORL.png" alt="Orlando Magic" width="30" height="30" border="0" /&gt;&lt;/a&gt;
  </code></pre>
  
  <p>How can I shorten it to only give me, <code>http://sports.cbsimg.net/images/nba/logos/30x30/ORL.png.</code> </p>
  
  <p>My code: </p>
  
  <pre><code>import urllib2
  from BeautifulSoup import BeautifulSoup
  # or if your're using BeautifulSoup4: 
  # from bs4 import BeautifulSoup
  
  soup = BeautifulSoup(urllib2.urlopen('http://www.cbssports.com/nba/draft/mock-draft').read())
  
  rows = soup.findAll("table", attrs = {'class': 'data borderTop'})[0].tbody.findAll("tr")[2:]
  
  for row in rows:
    fields = row.findAll("td")
    if len(fields) &gt;= 3:
      anchor = row.findAll("td")[1].find("a")
      if anchor:
        print anchor
  </code></pre>