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

Posted by iggykoopa on Mon 26th Jan 03:51 (modification of post by iggykoopa view diff)
diff | download | new post

  1. #!/usr/bin/env python
  2.  
  3. import urllib2
  4. from BeautifulSoup import BeautifulSoup
  5.  
  6. address = "http://distrowatch.com/"
  7. try:
  8.     website = urllib2.urlopen(address)
  9.     soup = BeautifulSoup(''.join(website))
  10.     rankings = soup.find(text= "Page Hit Ranking").findParent("table").find(text="CrunchBang").findParent("tr").find("th").string
  11.     print rankings
  12. except:
  13.     print "Not Available"

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with @@


Remember me