Web Page Automation/Scheduling

  • s15199d
  • Expert
  • Expert
  • User avatar
  • Posts: 524
  • Loc: NC, USA

Post 3+ Months Ago

I have a web page (we'll call it Page1.asp) that does a lot of calculations and kicks off 2 more pages (Page2.asp and Page3.asp) that also do a lot of calculations for us.

Right now, we have someone who's job it is to browse to and kick off Page1.asp every morning. Page1 loads Page2 and Page3 via JavaScript and form posts as seen here:

Code: [ Select ]
<%
'POPUP Page2.asp IN A NEW WINDOW AND RUN
    response.Write("<script>window.onload = function (){window.onload={};document.getPage2.submit();}</script>")
'POPUP Page3.asp IN A NEW WINDOW AND RUN
    response.Write("<script>window.onload = function (){window.onload={};document.getPage3.submit();}</script>")
%>
<form name="getPage2" action="page2.asp" method="POST" target="_blank"></form>
<form name="getPage3" action="page3.asp" method="POST" target="_blank"></form>
  1. <%
  2. 'POPUP Page2.asp IN A NEW WINDOW AND RUN
  3.     response.Write("<script>window.onload = function (){window.onload={};document.getPage2.submit();}</script>")
  4. 'POPUP Page3.asp IN A NEW WINDOW AND RUN
  5.     response.Write("<script>window.onload = function (){window.onload={};document.getPage3.submit();}</script>")
  6. %>
  7. <form name="getPage2" action="page2.asp" method="POST" target="_blank"></form>
  8. <form name="getPage3" action="page3.asp" method="POST" target="_blank"></form>


Is there any way to automate/schedule Page1.asp?

Thanks in advance!
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13503
  • Loc: Florida

Post 3+ Months Ago

Is the computer it needs to be scheduled on one that someone will eventually log on to sometime throughout each day ?

If so, the easy thing to do is probably going to be create an Automated Task via the usual Windows Task Scheduler that schedules a browser, and passes the URL of the page as an argument since most browsers will navigate to any URL passed as an argument when they open.

That way the task will run every day, and whoever logs on later in the day can just close the browser window.
  • s15199d
  • Expert
  • Expert
  • User avatar
  • Posts: 524
  • Loc: NC, USA

Post 3+ Months Ago

I was hoping to be able to schedule it on the webserver, and that would be a machine not routinely logged on to.

The goal is to completely automate the process. I didn't know you could open a browser with a specific URL as an argument via Windows Task Scheduler. Interesting.

If I can open a browser that way...I wonder too could I schedule it to close that browser instance...say an hour later? Or maybe write code at the end of page1, page2 and page3 to close the window...hmmmm

Thanks joebert...I'll check that out!!!
  • s15199d
  • Expert
  • Expert
  • User avatar
  • Posts: 524
  • Loc: NC, USA

Post 3+ Months Ago

Joebert, any insight how to specify a URL to the task in Windows Task Manager? I don't see where/how to do that.

Thanks in advance!
  • s15199d
  • Expert
  • Expert
  • User avatar
  • Posts: 524
  • Loc: NC, USA

Post 3+ Months Ago

Got it...
C:\PROGRA~1\INTERN~1\iexplore.exe www.domain.com/page1.asp
  • s15199d
  • Expert
  • Expert
  • User avatar
  • Posts: 524
  • Loc: NC, USA

Post 3+ Months Ago

Thank JoeBert! You're the man!

I've never run IE from Start >> Run like that before...
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13503
  • Loc: Florida

Post 3+ Months Ago

Quote:
I was hoping to be able to schedule it on the webserver, and that would be a machine not routinely logged on to.


The reason my first thought was to use Task Scheduler to launch the browser is you've got Javascript working there, which the server isn't going to execute if you have a simple bot fetch the page from the server. :)
  • s15199d
  • Expert
  • Expert
  • User avatar
  • Posts: 524
  • Loc: NC, USA

Post 3+ Months Ago

BTW...I should update my JS

Code: [ Select ]
<script>window.onload = function (){window.onload={};document.getJSON.submit();document.getGOOGLE.submit();document.getSEARCH.submit();}</script>


It works like a champ joebert! Kicked it off the other day and it's chugging along just perfect. Thanks again for your help.

Post Information

  • Total Posts in this topic: 8 posts
  • Users browsing this forum: No registered users and 113 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.