Heidegger has asked for the wisdom of the Perl Monks concerning the following question:
Dear Monks,
I'm trying to retrieve a web page with LWP::UserAgent. With most of the websites (http://www.bokstas.lt), it returns me the HTML string of the page. However, when I'm trying to retrieve one website (http://www.finasta.lt), I get an empty string and get no error. The website I'm trying to retrive has a long whitespace trace in the beginning. Has anyone encountered a problem when retrieving such content? My retrieve function is below:
sub retrieve_url() { my $ua = LWP::UserAgent->new; my $response = $ua->get(shift); if ($response->is_success) { return $response->content; } else { die $response->status_line; } }
Any help will be appreciated.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Retrieviing HTML with LWP::UserAgent
by saskaqueer (Friar) on May 26, 2004 at 10:40 UTC | |
Re: Retrieving HTML with LWP::UserAgent
by Somni (Friar) on May 26, 2004 at 10:45 UTC | |
by pg (Canon) on May 27, 2004 at 01:31 UTC | |
Re: Retrieviing HTML with LWP::UserAgent
by markjugg (Curate) on May 26, 2004 at 14:49 UTC | |
Re: Retrieviing HTML with LWP::UserAgent
by linuxfro (Novice) on May 26, 2004 at 23:58 UTC | |
Re: Retrieviing HTML with LWP::UserAgent
by crenz (Priest) on May 26, 2004 at 22:45 UTC |