in reply to how to troubleshoot a http::request 404 problem
Broken code could cause it. :) This works fine–
use strict; use warnings; use LWP::UserAgent; my $ua = LWP::UserAgent->new; my $wetter = "http://www.peng.es/wetter/wetter.txt"; my $response = $ua->request( HTTP::Request->new('GET' => $wetter ) ); print $response->decoded_content, $/ __END__ <div align="center"><strong><span class="temp">15.3°C</span></stro +ng> <span class="resttemp">(59.5°F)<br><font size="-2">23:25 - 19 + Feb 2011</font></span></div>
When you have questions, you should post the exact code you’re running. What you posted doesn’t even create the UserAgent. Also, use strict and warnings, always.
Update: WWW::Mechanize will make all this stuff more pleasant.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: how to troubleshoot a http::request 404 problem
by lexthoonen (Initiate) on Feb 23, 2011 at 08:27 UTC | |
by lexthoonen (Initiate) on Feb 23, 2011 at 08:38 UTC | |
by lexthoonen (Initiate) on Feb 23, 2011 at 08:43 UTC |
In Section
Seekers of Perl Wisdom