Created
February 24, 2011 23:10
-
-
Save PavelPenkov/843090 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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