Jump to content

IE Form interaction


Recommended Posts

Hello everyone,

here is my situation, im trying to write a code that will automatically click the heal button for me.

Posted Image

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%>&nbsp;</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>&nbsp;&nbsp;<a href=/advanced_search?hl=en>Advanced Search</a><br>&nbsp;&nbsp;<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

$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

  • Moderators

@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 by big_daddy
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...