in reply to Mechanize Help

I used a shorter version of the url. This'll show you the html on STDOUT, or uncomment the open to save to log.
#!usr/bin/perl use strict; use warnings; use LWP::UserAgent; my $ua = LWP::UserAgent->new; $ua->timeout(2); $ua->env_proxy; my $response = $ua->get('http://www.justdial.com'); #open(STDOUT, '>', 'just_dial.html'); if ($response->is_success) { print $response->decoded_content; } else { die $response->status_line; }

Replies are listed 'Best First'.
Re^2: Mechanize Help
by Corion (Patriarch) on Jun 30, 2010 at 09:10 UTC

    For saving content, there also is the convenient ->save_content method. This also saves you the binmode call on STDOUT if you're trying to save binary data.