szabgab has asked for the wisdom of the Perl Monks concerning the following question:
I was expecting this to print 'one', but instead it printed 'fouronetwothree'. Am I misunderstand what XPath is supposed to do?use 5.010; use HTML::TreeBuilder::XPath; my $tree= HTML::TreeBuilder::XPath->new; my $html = <<'HTML'; <html> <title>four</title> <head> <title>one</title> </head> <body> <title>two</title> </body> <title>three</title> </html> HTML $tree->parse($html); say $tree->findvalue( '/html/head/title');
Should I use some other module?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: HTML::TreeBuilder::XPath returns things I don't need?
by choroba (Cardinal) on Oct 06, 2014 at 15:38 UTC | |
by szabgab (Priest) on Oct 06, 2014 at 15:58 UTC | |
Re: HTML::TreeBuilder::XPath returns things I don't need?
by toolic (Bishop) on Oct 06, 2014 at 15:46 UTC | |
by szabgab (Priest) on Oct 06, 2014 at 15:59 UTC | |
Re: HTML::TreeBuilder::XPath returns things I don't need?
by Anonymous Monk on Oct 06, 2014 at 23:20 UTC |
Back to
Seekers of Perl Wisdom