[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Omaha.pm] Help with parsing HTML



> Really, please go look at how it's done in WWW::Mechanize
> with HTML::Parser.  Once you get your head around callbacks, it's
> super simple. 

Ok I am getting closer.  The problem is it is is ignoring nested tags.

File:
<CFQUERY>
Blah blah <CFQUERYPARAM arg1=value1 etc> AND blah blah
</CFQUERY>

My Code:
  my $p = HTML::TokeParser->new($arg) or die $!;

  while ($p->get_tag("cfquery")) {
    my $query = $p->get_trimmed_text("/cfquery");
    print "$arg: $query\n";
    }

Returns:
Blah blah AND blah blah

How do I tell it to leave the tags in there?

-Ryan