PDA

View Full Version : I need a script for browser automation (W98)



soundjack
12-29-2002, 09:10 AM
Hi,
I´m looking for a small script to automate some steps in my browser. It should call a specified website every 10 minutes and send a form via submit-button on that page. There are no other inputs on this page.
Is that possible with vbs, and who can prog this for me?
I think it can work like this:
I create a offline-website with the html-form on it. When I load it into my browser, the programm should send the form to the defined url, which replies with the page that I want to see.
After 10 minutes this should be done again, to keep the displayed page fresh.

Thanks for any help solving this problem,
Jack

adamdelves
12-30-2002, 11:06 AM
I'm not quite sure what you want here. But there are a few ways of doing this:

You could create an internal Javascript program of VB Script program (n.b. VB script is only supported in Microsoft Internet Explorer) which is embedded in the HTML. This program will execute when the page is loaded or refreshed.

You could create a VB Script to run on windows script host which opens and instance of the webpage in internet explorer. The process can then be controlled from out side the browser.

A couple of questions:

Does the form require user input?
In which way is the forms input going to be passed to the website - POST / GET?
And what heppend after that?

soundjack
12-30-2002, 03:18 PM
Hi Adam,
Thanks for looking in.
The way this thing works doesn´t matter. It can be done via Javascript, VBScript or whatever a normal PC has on board. It should be just a little tool to keep data in the browser actual. The form sends inputs to a cgi-script which answers with the page that I want to see. It would be o.k. to start the browser with this page as a starting page. Then the form sends itself and the server answers with the data page. The form sends in post-mode.
I hope I answered your questions an you can now help me solving this problem.

Thanks,
Jack

adamdelves
12-30-2002, 05:23 PM
This is a Javascript function which can be inserted into an HTML page:
<pre>
&lt;script language="JavaScript1.1"&gt;
&lt;!--
function submit_form(frmName, interval)
{
document.forms[frmName].submit();
setTimeout("submit_form('" + frmName + "'," + interval + ")", interval);
}
--&gt;
&lt;/script&gt;
</pre>

Just call the function from within the document body supplying the form name and interval as the arguments:
<pre>
&lt;script language="JavaScript1.1"&gt;
&lt;!--
submit_form('frmSubmit', 3000);
--&gt;
&lt;/script&gt;
</pre>
Hope this is of some use!!