title: How to extract specific URL from HTML using Beautiful Soup?
body: <p>I want to extract specific URLs from an HTML page.</p>
  
  <pre><code>from urllib2 import urlopen
  import re
  from bs4 import BeautifulSoup
  
  url = http://bassrx.tumblr.com/tagged/tt    # nsfw link
  page = urlopen(url)
  html = page.read()    # get the html from the url
  
  # this works without BeautifulSoup, but it is slow:
  image_links = re.findall("src.\"(\S*?media.tumblr\S*?tumblr_\S*?jpg)", html)
  
  print image_links
  </code></pre>
  
  <p>The output of the above is exactly the URL, nothing else: <code>http://38.media.tumblr.com/tumblr_ln5gwxHYei1qi02clo1_500.jpg</code></p>
  
  <p>The only downside is it is very slow.</p>
  
  <p>BeautifulSoup is extremely fast at parsing HTML, so that's why I want to use it.</p>
  
  <p>The urls that I want are actually the <code>img src</code>. Here's a snippet from the HMTL that contains that information that I want.</p>
  
  <pre><code>    &lt;div class="media"&gt;&lt;a href="http://bassrx.tumblr.com/image/85635265422"&gt;
      &lt;img src="http://38.media.tumblr.com/tumblr_ln5gwxHYei1qi02clo1_500.jpg"/&gt;
  &lt;/a&gt;&lt;/div&gt;
  </code></pre>
  
  <p><strong>So, my question is, how can I get BeautifulSoup to extract all of those 'img src' urls cleanly without any other cruft?</strong></p>
  
  <p>I just want a list of matching urls. I've been trying to use <code>soup.findall()</code> function, but cannot get any useful results.</p>