Skip to content

Instantly share code, notes, and snippets.

@PavelPenkov
Created February 24, 2011 23:10
Show Gist options
  • Save PavelPenkov/843090 to your computer and use it in GitHub Desktop.
Save PavelPenkov/843090 to your computer and use it in GitHub Desktop.
from urllib2 import urlopen
import HTMLParser
class MyParser(HTMLParser.HTMLParser):
def handle_starttag(self, tag, attrs):
pass
def handle_data(self, data):
print data
i = 1
parser = MyParser()
for s in urlopen('http://www.mail.ru/'):
print '%d:%s' % (i, s)
parser.feed(s)
i+=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment