in reply to LWP::SIMPLE fails on certain URL

I just ran your code and I got a complete HTML page back as response. It might be possible that when you were trying your script, the target web site might be having some problems of its own...and since there was no error checking being done in your code,well,network issues on the target side might have been the problem

Replies are listed 'Best First'.
Re: Re: LWP::SIMPLE fails on certain URL
by cdherold (Monk) on Jan 27, 2002 at 14:30 UTC
    Criminy ... I wonder why this still isn't working for me. I just tried again with the same result of nothing fetched at all.

    #!/usr/bin/perl use LWP::Simple; use LWP::UserAgent; use DBI; use CGI::Carp qw/ fatalsToBrowser /; print "Content-type: text/html\n\n"; $url = "http://wire.ap.org/APnews/center_minor.html?FRONTID=SCIENCE"; $body = get("$url"); print "$body";

    Is there something I'm missing here. I wouldn't think so because when i do this for other pages they all come out fine. Hmm ... still a little confused.

      Try changing your content type to 'text/plain' or escape the html with something like HTML::Entities. I have a feeling that $body contains the correct stuff, its just getting misinterpreted somewhere between the variable and the 'view source' window of your browser...

      -Blake