triticale has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to download the following webpage:
http://www.nasdaq.com/earnings/earnings-calendar.aspx?date=2014-Oct-02
Firstly I used LWP::Simple, but did not get anything downloaded. Then I used WWW::Mechanize, and finally got a file created. But when I looked into the file when opening it, I saw nothing but weird letters. The following are the codes I used.
use WWW::Mechanize;
$url = "http://www.nasdaq.com/earnings/earnings-calendar.aspx?date=2014-Oct-02";
$local_file_name = 'getkml.txt';
$mech = WWW::Mechanize->new;
$mech->get( $url, ":content_file" => $local_file_name );
My questions are:
1. Should I convert the file to a plain text file? How may I reach it?
2. Is there an alternative way to download this webpage?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problem saving webpage content into a file
by Corion (Patriarch) on Oct 06, 2014 at 12:36 UTC | |
|
Re: Problem saving webpage content into a file
by pme (Monsignor) on Oct 06, 2014 at 12:40 UTC | |
by Corion (Patriarch) on Oct 06, 2014 at 12:52 UTC |