danny0085 has asked for the wisdom of the Perl Monks concerning the following question:
I need to extract links from a html file (not all). Here are the xpaths
/html/body/p/a /html/body/p[2]/a /html/body/p[3]/a .... /html/body/p[66]/a
how can extract the links with TreeBuilder?
here is what I have I do not know how to use the findvalues function
$mech->get($url); $content = $mech->response()->decoded_content(); my $tree = HTML::TreeBuilder::XPath->new; $tree->parse($content); $tree->eof; @res = $tree->findvalues(???);#
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Help with xpath and TreeBuilder
by Gangabass (Vicar) on Jun 29, 2012 at 11:04 UTC | |
by Anonymous Monk on Jun 29, 2012 at 12:09 UTC | |
|
Re: Help with xpath and TreeBuilder
by Anonymous Monk on Jun 29, 2012 at 06:19 UTC | |
by danny0085 (Sexton) on Jun 29, 2012 at 06:32 UTC | |
by Corion (Patriarch) on Jun 29, 2012 at 06:33 UTC |