#!/usr/bin/env python import urllib2 from BeautifulSoup import BeautifulSoup address = "http://distrowatch.com/" try: website = urllib2.urlopen(address) soup = BeautifulSoup(''.join(website)) rankings = soup.find(text= "Page Hit Ranking").findParent("table").find(text="CrunchBang").findParent("tr").find("th").string print rankings except: print "Not Available"