atomicrabbit Posted October 8, 2010 Share Posted October 8, 2010 Anyone have code to do this? I found this code, but for some reason it's not getting/submitting the form properly Set IE = CreateObject("InternetExplorer.Application") set WshShell = WScript.CreateObject("WScript.Shell") IE.Navigate "http://www.somewebsite.com/form.php" IE.Visible = True Wscript.Sleep 2000 call IE.Document.Forms(3).Submit() It is the 4th form on the page, but i get the following error: Object doesn't support this property or method 'IE.Document.Forms(...).Submit' Any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/215452-vbscript-open-webpage-submit-form-close/ Share on other sites More sharing options...
atomicrabbit Posted October 8, 2010 Author Share Posted October 8, 2010 got it to work now. Not sure why but I had to make a slight change to the last line of code in order for the form to be submitted properly: call IE.Document.Forms("formName").elements("Submit").click Now all I need to figure out how to close the IE window after it's done. How do I do that? Quote Link to comment https://forums.phpfreaks.com/topic/215452-vbscript-open-webpage-submit-form-close/#findComment-1120366 Share on other sites More sharing options...
atomicrabbit Posted October 8, 2010 Author Share Posted October 8, 2010 ok, sorry for bugging you guys. I figured out how to close the IE window after it was finished. Here's the final code: 'Create IE obect Set IE = CreateObject("InternetExplorer.Application") set WshShell = WScript.CreateObject("WScript.Shell") 'Go to webstie IE.Navigate "http://www.somewebsite.com/form.php" IE.Visible = True Wscript.Sleep 2000 'Submit form call IE.Document.Forms("formName").elements("Submit").click Wscript.Sleep 2000 'Close IE objIE.Quit Set objIE = Nothing Quote Link to comment https://forums.phpfreaks.com/topic/215452-vbscript-open-webpage-submit-form-close/#findComment-1120377 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.