Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: how to read data from a URL

by xhunter (Sexton)
on May 15, 2007 at 23:29 UTC ( [id://615661]=note: print w/replies, xml ) Need Help??


in reply to Re: how to read data from a URL
in thread how to read data from a URL

# An example using WWW::Mechanize and URI::Escape

use strict;

use WWW::Mechanize;
# Create a new mechanize object
my $mech = WWW::Mechanize->new();
my $url = 'http://www.exampleurl.com/';
# Associate the mechanize object with a URL
$mech->get($url);
# Print the content of the URL
print $mech->content;

# Load URL::Escape to escape URI's with uri_escape method.
use URI::Escape;
my @links = $mech->links;
foreach my $link (@links) {
    print uri_escape($link->url), "\n";   
}

Log In?
Username:
Password:

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

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

    No recent polls found