Solved

Save page from cgi script

Posted on 2011-09-08
6
412 Views
Last Modified: 2012-05-12
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.
0
Comment
Question by:mertez
  • 2
  • 2
6 Comments
 
LVL 28

Assisted Solution

by:FishMonger
FishMonger earned 200 total points
ID: 36502960
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
 

Author Comment

by:mertez
ID: 36503046
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
 
LVL 28

Expert Comment

by:FishMonger
ID: 36503224
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
 

Author Comment

by:mertez
ID: 36503551
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
 
LVL 82

Accepted Solution

by:
leakim971 earned 300 total points
ID: 36509757
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question