cbouwkamp has asked for the wisdom of the Perl Monks concerning the following question:
I am wondering if this is an okay way to obtain those types of files or not? I know the file is corrupted because when I click the link myself and download the file it works fine. The file is a kmz file which is basically an image overlay of weather that can be used on google earth or other web maps. When I open them up in notepad they are very jarbled symbols but look relatively the same. i dont know about the unicode flavor.#!/usr/bin/perl -w use strict; use LWP; use WWW::Mechanize; my $now_string = localtime; my $mech = WWW::Mechanize->new(); my $filename = join('_', split(/\W+/, $now_string, -1)); $mech->credentials( '*********' , '***********'); $mech->get('http://datawww2.wxc.com/kml/echo/MESH_Max_180min/') or die + "Error: failed to load the web page"; #print $mech->response()->content(); $mech->follow_link(n => 8) or die "Error: failed to download content"; + $mech->save_content("$filename.kmz");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Trouble downloading files
by desemondo (Hermit) on Jul 08, 2010 at 03:38 UTC | |
|
Re: Trouble downloading .KMZ files with www-mechanize
by Sinistral (Monsignor) on Jul 08, 2010 at 12:35 UTC | |
|
Re: Trouble downloading .KMZ files with www-mechanize
by ww (Archbishop) on Jul 08, 2010 at 12:53 UTC |