HarshaKuchampudi Posted January 20, 2014 Share Posted January 20, 2014 Hello! I am new to the AutoIt Forums, so I apologize in advance if my question is unclear or doesn't make much sense. I am trying to click a submit button on a webpage. The button has the following HTML: <input type="submit" value="Search"> I am attempting to use the following code to click it: $oTags = _IETagNameGetCollection($oIE, "input") For $oTag In $oTags If String($oTag.Value) == "Search" Then _IEAction($oTag, "click") _IELoadWait($oIE) EndIf Next The problem is that the code above is selecting ANOTHER submit button with the same HTML line that comes before the desired button. Is there any way that I can specify to click the second submit button rather than the first? Thank you for your help! Harsha Link to comment Share on other sites More sharing options...
Solution HarshaKuchampudi Posted January 20, 2014 Author Solution Share Posted January 20, 2014 Fixed the problem by narrowing the field of search as follows: $UserSearchBox = _IEGetObjById($oIE, "search_mts") $oTags = _IETagNameGetCollection($UserSearchBox, "input") For $oTag In $oTags If String($oTag.Value) == "Search" Then _IEAction($oTag, "click") _IELoadWait($oIE) EndIf 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