title: retrieve specific links from web page using python and BeautifulSoup
body: <p>I have been trying to retrieve href link from a page and using as a variable for next href link. But I stuck at one point where I have multiple href links with the different file extension(like zip,md5 etc) and only needed to a zip extension file. here is the code I am trying to implement.</p>
  
  <pre><code>import httplib2
  from BeautifulSoup import BeautifulSoup, SoupStrainer
  http = httplib2.Http()
  status, response = http.request('http://example.com')
  for link in BeautifulSoup(response, parseOnlyThese=SoupStrainer('a')):
      if link.has_key('href'):
         if '/abc' in link['href']:
            basename = link['href'].split("/")[11]
            print basename
  
          status, response = http.request('http://example.com/%basename',basename)
          for link in BeautifulSoup(response, parseOnlyThese=SoupStrainer('a')):
              if link.has_key('href'):
                  if '/abc' in link['href']:
                      basename = link['href'].split("/")[11]
                      print basename
  </code></pre>