#!/usr/bin/python #Print out obfuscated slashdot email addresses from their most commented on story from BeautifulSoup import BeautifulSoup import urllib2, re opener = urllib2.build_opener() opener.addheaders = [('User-agent', 'Mozilla/5.0')] slashdot = opener.open('http://politics.slashdot.org/politics/04/11/03/1637232.shtml') slashdot = BeautifulSoup(slashdot.read()) addresses = [address.string for address in slashdot.findAll(attrs={'href':re.compile('mailto.*')})] for i in range(len(addresses)): print addresses[i]