Sign in to follow this  
Followers 0
RAMzor

IE UDF

4 posts in this topic

#1 ·  Posted (edited)

Hi All, im a newbie in webscripting.

How can I filling related input fields on this Page?

I have tried this code:

_BankLeumiLogin( "AAAA", "BBBBB", "CCCC")
Func _BankLeumiLogin( $UserID, $Password, $Auth )
    $oIE = _IECreate()
    _IENavigate($oIE, "https://hb2.bankleumi.co.il/Homebank/pre_default.asp")
    $o_Form = _IEFormGetObjByName($oIE, "form2")
    $o_UserID   = _IEFormElementGetObjByName($o_Form, "uid")
    $o_Auth = _IEFormElementGetObjByName($o_Form, "auth_field")
    $o_Passw    = _IEFormElementGetObjByName($o_Form, "password")
    
    _IEFormElementSetValue($o_UserID, $UserID)
    _IEFormElementSetValue($o_Auth, $Auth)
    _IEFormElementSetValue($o_Passw, $Password)
    _IEFormSubmit($o_form)
EndFunc
Exit
Edited by RAMzor

Share this post


Link to post
Share on other sites



Is this a phishing site?

Share this post


Link to post
Share on other sites

You did well in tearing apart the form to get the element names in this code. What you missed however is that the form is in a frame (named "body") in a frameset, so you need to get a reference to that frame instead of the top level. Something like this:

$oFrame = _IEFrameGetObjByName($oIE, "body")
Insert this after your Navigate command and then use $oFrame instead of $oIE in your _IEFormGetObjByName command.

Also notice that the buttons have onclick Javascript tied to them. Because of this it may be necessary to perform a .click action on them to submit the form instead of using the generic form submit action. You should be able to create a reference to the buttons in a similar way that you did the input fields an then do $oButton.click

Dale

Hi All, im a newbie in webscripting.

How can I filling related input fields on this Page?

I have tried this code:

_BankLeumiLogin( "AAAA", "BBBBB", "CCCC")
Func _BankLeumiLogin( $UserID, $Password, $Auth )
    $oIE = _IECreate()
    _IENavigate($oIE, "https://hb2.bankleumi.co.il/Homebank/pre_default.asp")
    $o_Form = _IEFormGetObjByName($oIE, "form2")
    $o_UserID   = _IEFormElementGetObjByName($o_Form, "uid")
    $o_Auth = _IEFormElementGetObjByName($o_Form, "auth_field")
    $o_Passw    = _IEFormElementGetObjByName($o_Form, "password")
    
    _IEFormElementSetValue($o_UserID, $UserID)
    _IEFormElementSetValue($o_Auth, $Auth)
    _IEFormElementSetValue($o_Passw, $Password)
    _IEFormSubmit($o_form)
EndFunc
Exit

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Hi Dale,

It's worked nice!!!

Thank you wery much!

P.S. This is National Bank of Israel

Edited by RAMzor

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  
Followers 0