bundyxc Posted October 29, 2009 Posted October 29, 2009 I'm automating a web task, and need to click this: <button class="action" tabindex="503">Update</button> As you can see, it isn't a link, it doesn't have an ID, or a name. Any ideas on how to click it? Global $arr[2] $arr[0]="hip" $arr[1]="hip" ;^^ hip hip array. ^^
PsaltyDS Posted October 29, 2009 Posted October 29, 2009 Look at the _IE* functions in the help file. You can get the collection of buttons by _IETagNameGetCollection($oForm, "button") and then loop through the collection looking for $oButton.tabIndex = 503 and/or $oButton.innerText = "Update". Once you find it, you would click it with _IEAction($oButton, "click"). Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
bundyxc Posted October 29, 2009 Author Posted October 29, 2009 Alright, so how would I loop through the collection? $update_submit = _IETagNameGetCollection ($browser, "button") _IEAction($update_submit,"click") Throws this error: C:\Program Files\AutoIt3\Include\IE.au3 (2795) : ==> The requested action with this object has failed.: $o_object.Click() $o_object.Click()^ ERROR >Exit code: 1 Time: 11.027 Global $arr[2] $arr[0]="hip" $arr[1]="hip" ;^^ hip hip array. ^^
PsaltyDS Posted October 29, 2009 Posted October 29, 2009 Alright, so how would I loop through the collection? $update_submit = _IETagNameGetCollection ($browser, "button") _IEAction($update_submit,"click") Throws this error:C:\Program Files\AutoIt3\Include\IE.au3 (2795) : ==> The requested action with this object has failed.: $o_object.Click() $o_object.Click()^ ERROR >Exit code: 1 Time: 11.027 Look at the example script under _IETagNameGetCollection() in the help file. Notice the For/In/Next loop for walking through the collection one object at a time ($oInput in the example). In your loop, you want to test each one until you find the right one (as I described earlier), then do your "click" and exit the loop. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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