Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Mechanize to TreeBuilder-XPath

by kelchris (Novice)
on Jan 27, 2012 at 03:30 UTC ( #950254=note: print w/replies, xml ) Need Help??


in reply to Mechanize to TreeBuilder-XPath

I would suggest using Mojo::UserAgent
use strict; use Mojo::UserAgent; my $ua = Mojo::UserAgent->new; my $tx = $ua->get("www.amazon.com"); $ua->max_redirects(5); $tx->res->dom('li.navSaChildItem')->each(sub { my $item = $_; print "[CSS3 Selector] Departments: ".$item->a->text."\n"; }); print "Title: ".$tx->res->dom->html->head->title->text."\n";

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2016-09-28 00:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (516 votes). Check out past polls.