huskies Posted May 28, 2009 Share Posted May 28, 2009 Hello everyone, here is my situation, im trying to write a code that will automatically click the heal button for me. and the following is the page source the button heal has no id of itself, and i can't figure out the name of the form, apparently it doesn't have 1. does anyone have any ideas? I tried using IEGetObjbyName I also tried to compare it to the google example in the help file but it isn't the same situation. <p> <center> <form action='springs.phtml' method='post'> <input type='hidden' name='type' value='heal'> <input type='submit' value='Heal my Pets'> </form> </center> <p> <center> <form action='springs.phtml' method='post'> <input type='hidden' name='type' value='purchase'> <input type='submit' value='See what is for sale'> </form> </center> <p> <center> <form action='index.phtml' method='get'> <input type='submit' value='Back to Faerieland'> </form> </center> <br><br><form action="/search" name=f><table cellpadding=0 cellspacing=0><tr valign=top><td width=25%> </td><td align=center nowrap><input name=hl type=hidden value=en><input autocomplete="off" maxlength=2048 name=q size=55 title="Google Search" value=""><br><input name=btnG type=submit value="Google Search"><input name=btnI type=submit value="I'm Feeling Lucky"></td><td nowrap width=25%><font size=-2> <a href=/advanced_search?hl=en>Advanced Search</a><br> <a href=/preferences? })(); </script> in google's case, the form had a name so you could use _IEFormElementGetObjByName <It Shall Be Done> Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted May 28, 2009 Moderators Share Posted May 28, 2009 Take a look at _IEFormGetCollection and _IEFormElementGetCollection Link to comment Share on other sites More sharing options...
Juvigy Posted May 29, 2009 Share Posted May 29, 2009 $oDoc = _IEDocGetObj($oIE) $oArray = $oDoc.getElementsByTagName("input") For $element in $oArray if $element.Value='Heal my Pets' and $element.type='submit' then _IEAction ($element,"click") _IELoadWait ($oIE) EndIf next Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted May 29, 2009 Moderators Share Posted May 29, 2009 (edited) @Juvigy - If you are going to post code at least make it complete with all includes and run tidy on it before posting. #include <IE.au3> $sURL = "www.somewebpage.com" _IEErrorHandlerRegister() $oIE = _IECreate($sURL) $oForm = _IEFormGetCollection($oIE, 0) $oInput = _IEFormElementGetCollection($oForm, 1) _IEAction($oInput, "click")oÝ÷ ØêÚºÚ"µÍÚ[ÛYH ÒQK]LÉÝÂÌÍÜÕTH ][ÝÝÝÝËÛÛY]ÙXYÙKÛÛI][ÝÂÒQQÜ[YÚÝ BÌÍÛÒQHHÒQPÜX]J ÌÍÜÕT BÌÍÛÑÜHHÒQQÜQÙ]ÛÛXÝ[Û ÌÍÛÒQK BÒQQÜTÝXZ] ÌÍÛÑÜJ Edited May 29, 2009 by big_daddy 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