in reply to How to get undecoded html entities with HTML::TreeBuilder
#!/usr/bin/perl use warnings; use strict; use HTML::TreeBuilder; my $html = <<'HTML'; <a href="http://www.nowhere.com/?action=a1&param=p1">Some text</a> HTML my $tree = HTML::TreeBuilder->new_from_content( $html ); for my $elt ($tree->look_down ('_tag', 'a')) { print "\nA " . HTML::Entities::encode($elt->attr ('href')) . "\n\n +"; }
Others might involve hacking the modules you use.
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to get undecoded html entities with HTML::TreeBuilder
by naikonta (Curate) on May 18, 2007 at 01:42 UTC | |
|
Re^2: How to get undecoded html entities with HTML::TreeBuilder
by Krambambuli (Curate) on May 20, 2007 at 09:42 UTC |