has anyone implemented perl's HTML::Element and related modules for python?

Walter Dörwald walter at livinglogic.de
Mon Jun 2 12:12:52 CEST 2003


Jack Diederich wrote:

> On Sat, May 31, 2003 at 12:30:43PM +0000, Tom Bryan wrote:
> 
>> [...]
>>>From a quick look at CPAN, it looks like that's a way to represent an HTML 
>>doc as a collection of objects...probably  using some sort of Composite 
>>Pattern.  If that's what you're talking about, I think that  HTMLgen is 
>>probably similar
>>http://starship.python.net/crew/friedrich/HTMLgen/html/main.html
> 
> Less of a DOM but maybe what you are looking for is HyperText
> http://dustman.net/andy/python/HyperText/
> 
> It is used like
>   from HTML import *
>   A(IMG(border = 0, src = 'images/off.gif'), href = 'off.html')
> 
> Fairly simple, I don't do anything complicated w/ HTML so I like it.
> It also throws a fit if attributes aren't in the HTML4.0 spec (which most
> of the time means you made a typo).

You might also take a look at XIST (available at
http://www.livinglogic.de/Python/xist/),
which uses the same basic principles (HTML elements as Python classes),
but is XML based and is still actively maintained.

Bye,
    Walter Dörwald





More information about the Python-list mailing list