Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Roderick Schertler
June 20, 2005, 1:56 pm
rate this thread
Consider this HTML::Element dump of a simple HTML page:
I've got to find the <p> after first searching for the <h1>. Because of
the <div> I can't use $h1->right. My first thought was to start from
$h1->pindex in $h1->parent->content_list, but this would fail if there
were even more levels between the two.
I really need to continue a walk of the tree, starting at h1. I can't
find an HTML::Element method which does that. It is an easy enough
iterator to write, but it seems so basic a need that I figure it's there and
I'm missing it. Is it?
It also seems to me that there should be something like ->look_down
(->look_next?) which does a search like this, for the same reason.
- Terrence Brannon
September 5, 2005, 8:28 am
Re: HTML::Element->right/->look_down lose, I need to walk the tree
you want a sibling of $tree->look_down('_tag' => 'h1') ;
if you use HTML::Element::Library on CPAN you can do this with easeeeee
you can always use look_up after looking down :)
again HTML::Element::Library contains all of my tree-grokking routines
+ the ones from Matthew Sisk's code for this HTML::Element hax
Carter's Compass: I know I'm on the right track when,
by deleting something, I'm adding functionality.
- » ssh on command line: force using a group size (prime size) of 1024 (and no...
- — The site's Newest Thread. Posted in » Secure Shell Forum