in reply to Re: LWP::SIMPLE fails on certain URL
in thread LWP::SIMPLE fails on certain URL

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.

Replies are listed 'Best First'.
Re: Re: Re: LWP::SIMPLE fails on certain URL
by blakem (Monsignor) on Jan 27, 2002 at 14:42 UTC
    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