Explorer Scripting

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
crozzer
Newbie
Posts: 4
Joined: Wed Mar 03, 2004 12:14 am

Explorer Scripting

Post by crozzer » Wed Mar 03, 2004 1:58 am

Hi,
Can somebody point me to an online resource that shows how to use VBScript to interact with IE? I can use Create, Navigate, Delete, etc., but I want more? How can I post a form, etc.
Thanks!

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Wed Mar 03, 2004 7:23 am

Can use Macro Scheduler HTTPRequest> to post forms.
From the Help file:
HTTPRequest>URL,[LocalFilename],Method,[POST_Data],Result_Variable[,ProxyServer,ProxyPort]

Retrieves a web document via the HTTP protocol using either GET or POST methods.

URL: URL of document to retrieve
LocalFileName: Optional (may be left blank) - local file to save response to.
Method: GET or POST
Post_Data: Data to Post to URL if using POST method. Use name=value pairs separated by '&'. See example below.
Result_Variable: Stores result of operation. If successful this will contain the HTML returned. Otherwise it will contain an error message.
ProxyServer: Optional - if using a proxy server set this to domain or IP address of proxy server.
ProxyPort: Optional - if using a proxy server, set to port number of proxy server.

Abbreviation : HTT

Example

The following line does a simple GET request and saves the resulting HTML to a variable called HTMLResponse:

HTTPRequest>http://www.mjtnet.com,,GET,,HTMLResponse

The following line does the same thing but also saves the output to a file:

HTTPRequest>http://www.mjtnet.com,d:\HTML\mjtnet.html,GET,,HTMLResponse

This demonstrates a POST operation, sending name=value pairs to the page:

Let>PostData=email=[email protected]&name=Joe Bloggs
HTTPRequest>http://www.someplace.com/someform.html, ... MLResponse
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

crozzer
Newbie
Posts: 4
Joined: Wed Mar 03, 2004 12:14 am

Post by crozzer » Wed Mar 03, 2004 5:44 pm

Bob,
The help file info is very useful, but won't work in this situation b/c I have to go through the browser to get through security. When I make an HTTPRequest from MS, I don't have the authentication necessary.

Does anybody know where to get VBScript info for IE?

Thanks,

Crosby

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Wed Mar 03, 2004 6:24 pm

Hi,

You should be able to authenticate with HTTPRequest. For server level username and password add it to the URL as follows:

username:[email protected]/somepage.htm

etc

For usernames/passwords requested by a web form just use a HTTPRequest with a POST operation sending the appropriate form data.
MJT Net Support
[email protected]

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts