Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^3: HTML::TreeBuilder:: identifing xpath-expression - first attempt

by Anonymous Monk
on Oct 17, 2010 at 09:20 UTC ( [id://865782]=note: print w/replies, xml ) Need Help??


in reply to Re^2: HTML::TreeBuilder:: identifing xpath-expression - first attempt
in thread HTML::TreeBuilder:: identifing xpath-expression - first attempt

Hi viveksnv
  • kcott doesn't have the problem, Perlbeginner1 does (clicking the correct reply/comment on link is important)
  • WWW::Mechanize won't help him extract html by xpath queries
  • Comment on Re^3: HTML::TreeBuilder:: identifing xpath-expression - first attempt

Replies are listed 'Best First'.
Re^4: HTML::TreeBuilder:: identifing xpath-expression - first attempt
by Khen1950fx (Canon) on Oct 17, 2010 at 23:17 UTC
    I experimented with this:
    #!/usr/bin/perl use strict; use warnings; use HTML::TreeBuilder::XPath; use LWP::Simple; use Test::WWW::Mechanize; use WWW::Mechanize::TreeBuilder; use Data::Dumper::Concise; my $tree = HTML::TreeBuilder::XPath->new; my $mech = Test::WWW::Mechanize->new; WWW::Mechanize::TreeBuilder->meta->apply($mech); $tree->parse_content(get 'http://www.educa.ch/dyn/79376.asp?id=1187'); print Dumper($tree->as_text('//tr'));
    Update:: not finished - will integrate $mech->find_xpath later.
      hello Khen1950fx

      that looks great!

      a find_Xpath would be amazing

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2024-04-23 06:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found