ANN: pullparser 0.0.1a released
John J. Lee
jjl@pobox.com
19 Dec 2003 22:40:12 +0000
http://wwwsearch.sourceforge.net/bits/pullparser.py
http://wwwsearch.sourceforge.net/bits/test_pullparser.py
This is the initial alpha release, but it's simple, working,
documented & tested, and I don't anticipate any significant changes.
A simple "pull API" for HTML parsing, after Perl's HTML::TokeParser.
Many simple HTML parsing tasks are simpler this way than with the
HTMLParser module. pullparser.PullParser is a subclass of
HTMLParser.HTMLParser.
Requires Python 2.2.
Example:
import pullparser, sys
f = file(sys.argv[1])
p = pullparser.PullParser(f)
if p.get_tag("title"):
title = p.get_compressed_text()
print "Title: %s" % title
John