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

Re: playing an array of google search results

by inman (Curate)
on Nov 29, 2005 at 15:46 UTC ( [id://512677]=note: print w/replies, xml ) Need Help??


in reply to playing an array of google search results

I have made a number of changes to your code. You were declaring @urls twice. You get a list of objects from the find_all_links method. You need to iterate over the list and get the URL of each object.
use strict; use warnings; use WWW::Mechanize; my $agent = WWW::Mechanize->new(); my $regex = 'results'; my $url ='http://www.google.co.uk/search?hl=en&safe=off&q=intitle%3A%2 +2football+scores%22+inurl%3Aresults&meta=cr%3DcountryUK%7CcountryGB'; $agent->get($url); $agent->agent_alias( 'Windows IE 6' ); my @urls = $agent->find_all_links(); foreach my $link(@urls) { print "Link: ", $link->url(), "\n"; } # print out the content of the current page for debugging print $agent->response()->as_string();

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2024-03-29 14:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found