CrunchBang Linux Pastebin - collaborative debugging

pastebin is a collaborative debugging tool allowing you to share and modify code snippets while chatting on IRC, IM or a message board.

This site is developed to XHTML and CSS2 W3C standards. If you see this paragraph, your browser does not support those standards and you need to upgrade. Visit WaSP for a variety of options.

CrunchBang Linux Pastebin

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
13
import urllib2
24
from BeautifulSoup import BeautifulSoup
46
address = "http://distrowatch.com/"
7+
try:
58
website = urllib2.urlopen(address)
69
soup = BeautifulSoup(''.join(website))
710
rankings = soup.find(text= "Page Hit Ranking").parent.parent.parent.find(text="CrunchBang").parent.parent.parent.find("th").string
811
print rankings
12+
except:
13+
    print "Not Available"

Syntax highlighting:

To highlight particular lines, prefix each line with @@


Remember me