in reply to Site seems to be blocking my LWP script

#!/usr/bin/perl -w use strict; use LWP::Simple; my $url = "http://www.perlmonks.org"; my $file = "output.txt"; my $proc = getstore($url, $file); print $proc;
This should tell you if you are getting the source or if there is an error connecting. It could be simply that the sight is down or the TTL is expiring before your script gets the source.

Just change the value of $url to whatever sight is giving you issues.

The return value of $proc will be the web server code for the connection attempt. A return value of 200 means successfull and a return value of like 500 or 403, or 404 are error codes and means sometyhing was wrong with the request and the web server could not or will not handle it.


www.perlskripts.com

Replies are listed 'Best First'.
Re^2: question about LWP
by dchandler (Sexton) on Aug 23, 2004 at 21:12 UTC
    Thanks so much for helping me out.

    Unfortunately, when i use the exact lines you have I get a code of 200, but I still get a blank document. I have tested this on a reliable site (google) and can get their source. but I cannot get the page I've been trying to get.