Hello all,
Trying to figure out how to post to website forms in IE without displaying the browser window... I've seen it done...
Any helps or tips? Thanks!
How to post to website forms in IE w/out opening browser
Moderators: Dorian (MJT support), JRL
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
I am actually using WebRecorder to generate the script I need... however, it opens several browser windows to execute the script. this gets messy when all I'm doing is posting to a form field. I'm not requiring the script to click on any web page objects, so not convinced a browser window is required to be open to accomplish the post to form.Bob Hansen wrote:See the HELP section for the HTTPRequest> command using the POST method.
Here's the code from WebRecorder
// Generated by MacroScript WebRecorder 1.72
// Recorded on Wednesday, January 7, 2009, at 12:37 AM
LibLoad>IEAuto.dll,hIE
If>hIE=0
MessageModal>Could not load IEAuto.dll, make sure it is in the path or edit the LibLoad line.
Goto>end_script
EndIf
//Move the mouse cursor out of harm's way to avoid causing mouseover events to interrupt
MouseMove>0,0
Let>delay=1
LibFunc>hIE,CreateIE,IE[0],0
LibFunc>hIE,Navigate,r,%IE[0]%,http://www.anywebsiteform.com/
LibFunc>hIE,WaitIE,r,%IE[0]%
Wait>delay
LibFunc>hIE,WaitIE,r,%IE[0]%
Wait>delay
Let>FrameName={""}
Let>FormName={""}
Let>FieldName={"accountnumber"}
Let>FieldValue={"344324843"}
LibFunc>hIE,FormFill,r,%IE[0]%,str:FrameName,str:FormName,str:FieldName,str:FieldValue,0
Let>FrameName={""}
Let>FormName={""}
Let>TagValue={"submit"}
LibFunc>hIE,ClickTag,r,%IE[0]%,str:FrameName,str:FormName,INPUT,NAME,str:TagValue
LibFunc>hIE,WaitIE,r,%IE[0]%
Wait>delay
LibFunc>hIE,WaitIE,r,%IE[0]%
Wait>delay
LibFree>hIE
Label>end_script
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Add this line after your CreateIE line:
//Hide IE
LibFunc>hIE,ShowIE,r,IE[0],0
//Hide IE
LibFunc>hIE,ShowIE,r,IE[0],0
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Yes, in the WebRecorder help.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?