cypher175 Posted April 10, 2009 Share Posted April 10, 2009 Are there any other ways to submit a form if _IEFormSubmit($Form) doesn't work..?? is there anyway to find the "Input type=submit" in the $Form object reference and then use that to submit the form..?? Something like $GetFormInputs = _IETagNameGetCollection($Form, 'input') For $Input in $GetFormInputs If $Input.type = "submit" Then (Somehow Submit $Form..??) Next Link to comment Share on other sites More sharing options...
Authenticity Posted April 10, 2009 Share Posted April 10, 2009 You can navigate to the page like: http://www.somesite.com/search?s=somethingtosearch&f=somethingtofilter Or if the form contain another input element to submit it's content like a button then you can reference this button and use _IEAction($oButton, 'click'). Link to comment Share on other sites More sharing options...
cypher175 Posted April 10, 2009 Author Share Posted April 10, 2009 Is there anyway to get an object reference to the Submit button by doing If $Input.type = "submit" Then $Submit = $Input.name _IEAction($Submit, 'click') or somthing along the lines of that by searching for the $Input.type = "submit" in the form..?? Link to comment Share on other sites More sharing options...
Authenticity Posted April 10, 2009 Share Posted April 10, 2009 Yup, you don't need the $Submit = $Input.name because it's just a string representation of the object name and not the object itself. For $oObject In $oObjects If $oObject.Type = "submit" Then _IEAction($oObject, 'click') ExitLoop EndIf Next Link to comment Share on other sites More sharing options...
cypher175 Posted April 10, 2009 Author Share Posted April 10, 2009 so do i need to get an object collection for the form 1st or what..?? Link to comment Share on other sites More sharing options...
Authenticity Posted April 10, 2009 Share Posted April 10, 2009 Yes. It's using _IEFormGetObjByName and then using _IETagNameGetCollection($oForm, 'input') and then start enumerating the inputs. Link to comment Share on other sites More sharing options...
cypher175 Posted April 10, 2009 Author Share Posted April 10, 2009 Sumthing like this or what..??For some reason the Submission of the Form on this page http://www.charlietheunicorn.info is being a pain in the biatch...think you can help me figure out why my code ain worken to submit that biatch..#NoTrayIcon #include <IE.au3> #include <Misc.au3> _Singleton(@ScriptName) $IE = _IECreate ("http://www.charlietheunicorn.info",0,1,1,0) $FindForm = _IETagNameGetCollection($IE, 'form') For $Form In $FindForm If StringInStr($Form.Action, 'index.php') Then $GetFormInputs = _IETagNameGetCollection($Form, 'input') For $Input in $GetFormInputs If $Input.type = "text" Then $Input.value = "http://www.url.com" If $Input.Type = "submit" Then _IEAction($Input, 'click') ExitLoop 2 Next EndIf next Link to comment Share on other sites More sharing options...
Authenticity Posted April 10, 2009 Share Posted April 10, 2009 Oh, sorry for making a mountain from the mouse. ;] #include <IE.au3> Dim $oIE = _IECreate('http://www.charlietheunicorn.info/') Dim $oQuery = _IEGetObjByName($oIE, 'q') Dim $oSubmit = _IEGetObjByName($oIE, 'submit') $oSubmit.ScrollIntoView() Sleep(1000) _IEFormElementSetValue($oQuery, 'http://www.autoitscript.com/') _IEAction($oSubmit, 'Click') Link to comment Share on other sites More sharing options...
cypher175 Posted April 10, 2009 Author Share Posted April 10, 2009 thanx, but im trying to submit the form without using either : Dim $oQuery = _IEGetObjByName($oIE, 'q') Dim $oSubmit = _IEGetObjByName($oIE, 'submit') im trying to do it on a blind bases by searching the form for certain things like "If $Input.type = "text" Then $Input.value = "http://www.url.com" and If $Input.Type = "submit" Then _IEAction($Input, 'click') Link to comment Share on other sites More sharing options...
Authenticity Posted April 10, 2009 Share Posted April 10, 2009 There you go, I still don't see the point: #include <IE.au3> Dim $sURL = 'http://www.autoitscript.com' Dim $oIE = _IECreate('http://www.charlietheunicorn.info/') Dim $oForms = _IEFormGetCollection($oIE) Dim $oInputs For $oForm In $oForms If StringInStr($oForm.Action, 'index.php') Then $oInputs = _IETagNameGetCollection($oForm, 'input') For $oInput In $oInputs $oInput.ScrollIntoView() Switch $oInput.Type Case 'text' _IEFormElementSetValue($oInput, $sURL) Case 'submit' _IEAction($oInput, 'click') ExitLoop(2) EndSwitch Next EndIf Sleep(50) Next Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now