Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: How to properly go through a WWW::Mechanize::Link object?

by Your Mother (Archbishop)
on Apr 23, 2020 at 07:28 UTC ( [id://11115933]=note: print w/replies, xml ) Need Help??


in reply to How to properly go through a WWW::Mechanize::Link object?

What Corion said. The @links are WWW::Mechanize::Link objects already–

use WWW::Mechanize; my $mech = WWW::Mechanize->new( autocheck => 0 ); $mech->get("https://perlmonks.org/?node=Recently+Active+Threads"); for my $link ( $mech->links ) { printf "* %s\n -> %s\n", $link->text, $link->url_abs; }

Replies are listed 'Best First'.
Re^2: How to properly go through a WWW::Mechanize::Link object?
by SergioQ (Beadle) on Apr 23, 2020 at 22:03 UTC

    First off, thank you. But this opens something that I've missed in Perl.

    What I was doing was:

    print "name\t\t$link->name\n";

    Which gave me:

    name WWW::Mechanize::Link=ARRAY(0x55bbd8e7d100)->name

    So what am I not understanding? Why does Perl not interpret this?

Log In?
Username:
Password:

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

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

    No recent polls found