__closed Posted July 31, 2009 Share Posted July 31, 2009 Hello! Help me, please. I need to click a button on a web page, but it did not have any ID or Name. Here is the code: <button style="width: 110px;" onclick="doonsubmit()" type="submit"> Link to comment Share on other sites More sharing options...
amokoura Posted July 31, 2009 Share Posted July 31, 2009 Check out manual -> UDF -> IE. There might be some helpers for enumerating website buttons and inspecting their properties. Link to comment Share on other sites More sharing options...
__closed Posted July 31, 2009 Author Share Posted July 31, 2009 (edited) Check out manual -> UDF -> IE.There might be some helpers for enumerating website buttons and inspecting their properties.Naturally there I looked, there IEFormElementGetObjByName, but this button has no "Name" Edited July 31, 2009 by brezenix Link to comment Share on other sites More sharing options...
Skruge Posted July 31, 2009 Share Posted July 31, 2009 Naturally there I looked, there IEFormElementGetObjByName, but this button has no "Name"Get all the elements with _IEFormElementGetCollection and loop through them until you find one whose .Type is "submit". [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font] Link to comment Share on other sites More sharing options...
__closed Posted July 31, 2009 Author Share Posted July 31, 2009 Get all the elements with _IEFormElementGetCollection and loop through them until you find one whose .Type is "submit". Like this? $oButtons = _IETagNameGetCollection ($oIE, "button") For $oButton In $oButtons If $oButton.type = "submit" Then _IEAction ($oIE, "click") Next Link to comment Share on other sites More sharing options...
Skruge Posted August 1, 2009 Share Posted August 1, 2009 Like this? $oButtons = _IETagNameGetCollection ($oIE, "button") For $oButton In $oButtons If $oButton.type = "submit" Then _IEAction ($oIE, "click") Next Did you try it? Did it work? I would replace _IETagNameGetCollection with _IEFormElementGetCollection though. [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font] Link to comment Share on other sites More sharing options...
__closed Posted August 1, 2009 Author Share Posted August 1, 2009 Did you try it? Did it work?I would replace _IETagNameGetCollection with _IEFormElementGetCollection though.No, I'm at home now and I not have Windows >_< I will try it on Monday at the work. Link to comment Share on other sites More sharing options...
__closed Posted August 3, 2009 Author Share Posted August 3, 2009 This is work: $oButtons = _IETagNameGetCollection ($oIE, "button") For $oButton In $oButtons If $oButton.type = "submit" Then _IEAction ($oButton, "click") Next Link to comment Share on other sites More sharing options...
Juvigy Posted August 3, 2009 Share Posted August 3, 2009 Also you have to keep in mind that this will only click the first button in the collection. If you have several buttons and you want to click not on the first button you have to think of something else to identify it. Link to comment Share on other sites More sharing options...
__closed Posted August 3, 2009 Author Share Posted August 3, 2009 Also you have to keep in mind that this will only click the first button in the collection.If you have several buttons and you want to click not on the first button you have to think of something else to identify it.Thank you. I'm aware of. Fortunately there is only one button to "submit" >_< 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