Save page from cgi script

I am doing a javascript file which will save 2 html pages and send them with outlook client every end of the month. Task scheduler will run the bat file to execute the .js file.

Sending mail will not be a problem, however I am looking how to save a html page which is returned by the cgi script (ex: http://192.x.x.x/status/getCounter.cgi).

Script is mentioned to open explorer, navigate to that specific url, save html from cgi script and send it. Probably there is no need to open explorer for this so if you have any other suggestion please share.

Thank you.
mertezAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
FishMongerConnect With a Mentor Commented:
If I understand you correctly, here's a minimal script without error handling which will retrieve and save a web page.
#!/usr/bin/perl

use strict;
use warnings;
use LWP::Simple;

my $url = 'http:://somewhere.com/webpage.html';
getstore($url, '/destination/path/to/webpage.html');

Open in new window

0
 
mertezAuthor Commented:
Thanks for your contribution but I was thinking to run it on win environment where perl is not installed by default. I was thinking about using javascript.. If you know any other  way to do it please share..

0
 
FishMongerCommented:
Is there a particular reason why you don't want to install Perl?

If you want to use a javascript only solution, then I'll leave that to someone else that has more javascript knowledge than I.

0
 
mertezAuthor Commented:
Script will run on a client computer and I am not so comfortable to install additional software just for running the script. However I will check how to do it in perl too..

thank you!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.