This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ezust
Recipients
Date 2004-11-09.16:55:45
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=935841

import sgmllib, urllib, urlparse
from sgmllib import SGMLParser


if __name__ == "__main__":
    url = "http://www.cs.uvic.ca/~gshoja/"
    parser = SGMLParser()
    data = urllib.urlopen(url).read()

    try:
        parser.feed(data)
    except sgmllib.SGMLParseError, ex:
        print "Pythonlib's error message: " + str(ex)
        line, offset = parser.getpos()
        lines = parser.rawdata.split("\n")
        print "My extra information: error at line %d offset
%d" % parser.getpos()
        print lines[line]
        print "%*s" % (offset, "^")
        parser = None 
History
Date User Action Args
2007-08-23 14:27:21adminlinkissue1063229 messages
2007-08-23 14:27:21admincreate