using IE5 HTML DOM parser in python ?

Fredrik Lundh fredrik at effbot.org
Thu Jan 11 13:53:39 EST 2001


Gilles Lenfant wrote:
> PS. Please don't reply "make politically correct HTML and it'll work" ! I
> agree but I don't lpan to parse HTML documents built by myself.

Well, you don't have to fix them yourself, of course:

    http://www.w3.org/People/Raggett/tidy/

Something like this should do the trick (on any platform):

    file = os.popen("tidy -asxml %s" % myfile)
    myparser.parse(file)

Cheers /F





More information about the Python-list mailing list