Sign in to follow this  
Followers 0
tokai6

How do I get the name of a textbox in IE?

9 posts in this topic

I've been using Autoit for sometime now... and now I am faced with this problem...

How do I get the name of textbox in the Internet Explorer... I tried looking at the source of the page... the name is static(it changes everytime I load the page) and an ID seems to be missing or theres no ID at all

<input name="user_89f7bf6f731c3a9cbc4418b63689f949" type="text" size="17" class="field_login">

thats the source... the alphanumeric after the "user_" is the one that changes...

Share this post


Link to post
Share on other sites



I've found debugbar - http://www.debugbar.com/ - good for this type of thing.

William

Share this post


Link to post
Share on other sites

I've found debugbar - http://www.debugbar.com/ - good for this type of thing.

William

thanks for replying...

but i used it the problem is still there... the name changes everytime I reload the page...

Share this post


Link to post
Share on other sites

thanks for replying...

but i used it the problem is still there... the name changes everytime I reload the page...

Could you use a wildcard or RegEx to find the other bits that remain static?

<input name="user_*" type="text" size="17" class="field_login">

Is this a public website?

William

Share this post


Link to post
Share on other sites

Could you use a wildcard or RegEx to find the other bits that remain static?

<input name="user_*" type="text" size="17" class="field_login">

Is this a public website?

William

I tried it...

$oIE = _IECreate("*******.com")

$o_form = _IEFormGetObjByName($oIE, 0)

$o_TBox = _IEFormGetObjByName($o_form,"user_*")

_IEFormElementSetValue($o_TBox,"USERNAME")

it results to...

--> IE.au3 V2.4-0 Warning from function _IEFormGetObjByName, $_IEStatus_NoMatch

--> IE.au3 V2.4-0 Error from function _IEFormElementSetValue, $_IEStatus_InvalidDataType

Yes its a public website... I just want to do a automatic login for it...

Share this post


Link to post
Share on other sites

I tried it...

$oIE = _IECreate("*******.com")

$o_form = _IEFormGetObjByName($oIE, 0)

$o_TBox = _IEFormGetObjByName($o_form,"user_*")

_IEFormElementSetValue($o_TBox,"USERNAME")

it results to...

--> IE.au3 V2.4-0 Warning from function _IEFormGetObjByName, $_IEStatus_NoMatch

--> IE.au3 V2.4-0 Error from function _IEFormElementSetValue, $_IEStatus_InvalidDataType

Yes its a public website... I just want to do a automatic login for it...

How about _IETagNameGetCollection and then identify the right one in your script?

What is the url?

William

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

How about _IETagNameGetCollection and then identify the right one in your script?

What is the url?

William

I tried the _IETagNameGetCollection but there are too much output for me handle...

Thanks anyways for the info on _IETagNameGetCollection im using it now... until i find a better code ill use this one for now... :blink:

Edited by tokai6

Share this post


Link to post
Share on other sites

$oInputs = _IETagnameGetCollection($oIE, "input")
For $oInput in $oInputs
    If String($oInput.className) = "field_login" Then
        $sName = $oInput.name
        ConsoleWrite($sName & @CRLF)
    EndIf
Next

Dale


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

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