Perl-Sensitive Sunglasses | |
PerlMonks |
Re: Link Extraction when grabbing web page with USER/PASSby zakb (Pilgrim) |
on Mar 04, 2003 at 09:08 UTC ( [id://240275]=note: print w/replies, xml ) | Need Help?? |
To get your idea working, you need to look at these lines of code:
Looking carefully at the bracketing in the second line, it appears it should be more like: $res = $ua->request($req, sub {$p->parse($_[0])});Your version was not passing the callback to call LinkExtor to the UserAgent request method. The call signature for the request method in the form you want it is: $response = $ua->request($request, \&callback);where $request is a HTTP::Request object and &callback is a sub or whatever.
In Section
Seekers of Perl Wisdom
|
|