Thank you all for the responses.

I now think this has nothing to do with
Geo::WebService::Elevation::USGS.  See
the script below for other web links that
LWP::Simple cannot reach and parse.  I have
not figured out why, but the problem is not
with USGS.pm,.


#!/usr/bin/perl
use strict;
use warnings;
use LWP::Simple;

chdir 'C:/Copy';

# Works

#my $test = get('http://osgeo-org.1560.x6.nabble.com/') or die 'Unable to get page'; # Works #my $test = get('https://www.chron.com/neighborhood/bayarea/') or die 'Unable to get page'; # Works #my $test = get('http://history.house.gov/Map/Mapping-Congress/') or die 'Unable to get page'; # Works
#my $test = get('http://hint.fm/wind/') or die 'Unable to get page'; # Works
#my $test = get('http://antwrp.gsfc.nasa.gov/apod/astropix.html') or die 'Unable to get page'; # Works


# Does not work

my $test = get('https://nationalmap.gov/epqs/') or die 'Unable to get page'; # Does not work #my $test = get('http://www.wrh.noaa.gov/zoa/mwmap3.php?map=usa') or die 'Unable to get page'; # Does not work #my $test = get('http://www.glorecords.blm.gov/') or die 'Unable to get page'; # Does not work #my $test = get('https://glorecords.blm.gov/default.aspx') or die 'Unable to get page'; # Does not work


print "\nAll done.\n\n\$test = $test\n\n";


__END__


There is stuff posted about this problem.  I have
been through using UserAgent, declaring the browser,
environment variables, and other things and it
still doesn't work.  Good thing I don't need this
or it would be driving me crazy.  I will probably
move on to other things now.



use strict;
use warnings;
use LWP::UserAgent;

$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0;


my $url = "https://nationalmap.gov/epqs/pqs.php";;

my $ua = LWP::UserAgent->new( ssl_opts => { verify_hostname => 0, } );


$ua->env_proxy;
$ua->agent("Mozilla/5.0 (Windows)");
my $response = $ua->get($url);

if ($response->is_success) {
     print $response->content;
} else {
   die $response->status_line;
}

print "All done.\n\n";

__END__


Mike


On 8/26/2019 10:26 PM, Uri Guttman wrote:
On 8/26/19 8:00 PM, Mike wrote:



use constant USGS_URL => 'https://ned.usgs.gov/epqs/pqs.php';
to
use constant USGS_URL => 'https://nationalmap.gov/epqs/pqs.php';


have you tried to just telnet to those hosts?

 telnet nationalmap.gov:443
telnet: could not resolve nationalmap.gov:443/telnet: Name or service not known
telnet ned.usgs.gov:443
telnet: could not resolve ned.usgs.gov:443/telnet: Name or service not known


so there is something wrong with the urls and not the code (or the code has bad urls).

and just getting the web pages is also failing

GET https://ned.usgs.gov/epqs/pqs.php
<error>General failure: Invalid Coordinates</error>

GET https://nationalmap.gov/epqs/pqs.php
<error>General failure: Invalid Coordinates</error>

i dunno the module but it seems that you may not be passing in any coordinates or something else is needed.

uri


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to