Re: confused by HTMLParser class

2008-05-28 Thread Stefan Behnel
globalrev wrote: > tried all kinds of combos to get this to work. In case you meant to say that you can't get it to work, consider using lxml instead. http://codespeak.net/lxml http://codespeak.net/lxml/lxmlhtml.html Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: confused by HTMLParser class

2008-05-27 Thread XLiIV
On May 28, 3:20 am, globalrev <[EMAIL PROTECTED]> wrote: > tried all kinds of combos to get this to work. > > http://docs.python.org/lib/module-HTMLParser.html > > from HTMLParser import HTMLParser > > class MyHTMLParser(HTMLParser): > >     def handle_starttag(self, tag, attrs): >         print "E

Re: confused by HTMLParser class

2008-05-27 Thread alex23
On May 28, 11:20 am, globalrev <[EMAIL PROTECTED]> wrote: > tried all kinds of combos to get this to work. Did you try searching this group? There were recent posts discussing basic usage of HTMLParser. Throwing random code together is the least likely way to actually get it to work. > x = MyHTM

confused by HTMLParser class

2008-05-27 Thread globalrev
tried all kinds of combos to get this to work. http://docs.python.org/lib/module-HTMLParser.html from HTMLParser import HTMLParser class MyHTMLParser(HTMLParser): def handle_starttag(self, tag, attrs): print "Encountered the beginning of a %s tag" % tag def handle_endtag(sel