Jump to content
Sign in to follow this  
RobertK

IE filling out form without a formname or submit button

Recommended Posts

RobertK

Hi all,

I've found this code in the example section:

#include <IE.au3>

$sBrin = ""
$sPass = ""

$sURL = "http://www.klassetv.nl/"
$oIE = _IECreate($sURL)
$oForm = _IEFormGetObjByName($oIE, "")
$oBrin = _IEFormElementGetObjByName($oForm, "school_loginnaam")
$oPassword = _IEFormElementGetObjByName($oForm, "school_wachtwoord")
$oButton = _IEGetObjByName($oForm, "")

_IEFormElementSetValue($oBrin, $sBrin)
_IEFormElementSetValue($oPassword, $sPass)
_IEAction($oButton, "click")

The site uses this form:

<form method="post" style="margin: 0px; padding: 0px;">

                            <input name="type" type="hidden" value="schoolaanmelding" />
                          <input name="action" type="hidden" value="inloggen" />
                          <img alt="inloggen" src="/images/inloggen_label.gif" />
                          <span><input class="footer_input" name="school_loginnaam" onfocus="if(this.value == 'brin') this.value = '';" onblur="if(this.value == '') this.value = 'brin';" type="text" value="brin" /></span>
                          <span><input class="footer_input" name="school_wachtwoord" onfocus="if(this.value == 'wachtwoord') this.value = '';" onblur="if(this.value == '') this.value = 'wachtwoord';" type="password" value="wachtwoord" /></span>
                          <input class="footer_button" src="/images/login_button.gif" type="image" />
                        </form>

As you can see, this form has no name tag defined and there is no submit button but an image (also without name).

I've looked all over the place, but since a name tag is part of the W3 standards (if I'm correct) nearly all sites have it. :)

If you can tell me how I can fill out this form, and perform the login automaticly please help me.

(ps sorry for the dutch text, but it's a dutch site on which there should be logged on)

//Robert K.

Edited by RobertK

[font="Verdana"]I've gone to find myself. If I get back before I return, please keep me here.[/font]

Share this post


Link to post
Share on other sites
PsaltyDS

Look at the examples in the help file under _IEFormGetCollection(). By default it returns a collection of all forms, but you can give it a 0-based index to a specific form, for example _IEFormGetCollection($oIE, 2) returns the third form.

If you don't know which form, or it changes on a dynamic page, get the collection and loop through them looking for the attribute/tag/text/etc. that will identify what you are looking for.

:)


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

Share this post


Link to post
Share on other sites
RobertK

Look at the examples in the help file under _IEFormGetCollection(). By default it returns a collection of all forms, but you can give it a 0-based index to a specific form, for example _IEFormGetCollection($oIE, 2) returns the third form.

If you don't know which form, or it changes on a dynamic page, get the collection and loop through them looking for the attribute/tag/text/etc. that will identify what you are looking for.

:)

thnx man :P

it works great, found that you can submit a form with _IEFormSubmit($oForm) ;)


[font="Verdana"]I've gone to find myself. If I get back before I return, please keep me here.[/font]

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.