in reply to Getting to grips with HTML::Parser
With Treebuilder, you do apperations on html viewed as a tree. You identify the elements you want with the $element->lookdown method, specifying criteria. For simple criteria, this can just be tag is blee, attribute a is bloo, attribute b is blah. For more complicated criteria you can write a subroutine.
Then you build up the replacement html with another subroutine, and do the replacement with $element->replace(new element). I'm not looking at the perldoc as I write this so I probably made some mistakes on the syntax, but that's the general idea.
Worked for me!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Getting to grips with HTML::Parser
by Anonymous Monk on Jun 02, 2006 at 16:33 UTC |