Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: HTML::TreeBuilder::XPath returns things I don't need?

by toolic (Bishop)
on Oct 06, 2014 at 15:46 UTC ( [id://1102989]=note: print w/replies, xml ) Need Help??


in reply to HTML::TreeBuilder::XPath returns things I don't need?

XML::Twig (by the same module author) can give you what you want:
use warnings; use strict; use XML::Twig; my $xml = <<XML; <html> <title>four</title> <head> <title>one</title> </head> <body> <title>two</title> </body> <title>three</title> </html> XML my $twig = XML::Twig->new( twig_handlers => { 'html/head/title' => sub { print $_->text(), "\ +n" } }, ); $twig->parse($xml); __END__ one

Replies are listed 'Best First'.
Re^2: HTML::TreeBuilder::XPath returns things I don't need?
by szabgab (Priest) on Oct 06, 2014 at 15:59 UTC
    Thanks

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1102989]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (1)
As of 2024-04-25 00:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found