Difference between
modified post 126 by iggykoopa on Mon 26th Jan 02:47 and
original post 125 by iggykoopa on Mon 26th Jan 02:36
Show old version | new version | both versions
| 1 | + | #!/usr/bin/env python | |
| 1 | 3 | import urllib2 | |
| 2 | 4 | from BeautifulSoup import BeautifulSoup | |
| 4 | 6 | address = "http://distrowatch.com/" | |
| 7 | + | try: | |
| 5 | 8 | website = urllib2.urlopen(address) | |
| 6 | 9 | soup = BeautifulSoup(''.join(website)) | |
| 7 | 10 | rankings = soup.find(text= "Page Hit Ranking").parent.parent.parent.find(text="CrunchBang").parent.parent.parent.find("th").string | |
| 8 | 11 | print rankings | |
| 12 | + | except: | |
| 13 | + | print "Not Available" |