Solved

Save page from cgi script

Posted on 2011-09-08
6
394 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

863 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now