[Zope] Accessing DOM nodes from python: how?
Dieter Maurer
dieter@handshake.de
Sun, 22 Dec 2002 19:07:42 +0100
Catonano wrote at 2001-12-22 11:49 +0100:
> My idea is that I have 2 alternative ways:
>
> 1) add a field property to each file and fill it with the code, then
> adding an index to my ZCatalog. Boring, error prone and time consuming.
>
> 2) ask my collagues to inclue the codes in the html files and get Zope
> access and index that values.
Python comes with modules to process and analyse HTML (and
other structured markup).
See the Python library reference, look for "htmllib".
Parsing HTML/SGML/XML in Python is quite expensive.
Do only as much processing as is necessary.
When you use these Python modules, you must do it either in
an External Method (or other filesystem based code) or
you must provide security declarations that it is safe to use
these modules from Python Scripts (the "Readme" tab of
the "Python Scripts" product tells you more).
Dieter