TokeParser

  • Thread starter kjhjhjhjadsasda
  • Start date
K

kjhjhjhjadsasda

Hi,

Im trying to use HTML::TokeParser to get all text with DIV tags, where
the DIV tag has class="x":

$stream=HTML::TokeParser->new(\$page);
while ($token=$stream->get_tag("div")) {
if ($token->[1]{class} eq "x") {
$text=$stream->get_trimmed_text("/div");
}
}

Problem with this is that it gives me the trimmed text obviously, eg
cleans away any html. I want everything with the DIV but cant find the
command for it in TokeParser...

Anyone know?

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top