tokai6 Posted August 1, 2010 Share Posted August 1, 2010 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... Link to comment Share on other sites More sharing options...
saywell Posted August 1, 2010 Share Posted August 1, 2010 I've found debugbar - http://www.debugbar.com/ - good for this type of thing. William Link to comment Share on other sites More sharing options...
tokai6 Posted August 1, 2010 Author Share Posted August 1, 2010 I've found debugbar - http://www.debugbar.com/ - good for this type of thing.Williamthanks for replying...but i used it the problem is still there... the name changes everytime I reload the page... Link to comment Share on other sites More sharing options...
saywell Posted August 1, 2010 Share Posted August 1, 2010 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 Link to comment Share on other sites More sharing options...
tokai6 Posted August 1, 2010 Author Share Posted August 1, 2010 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?WilliamI 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_InvalidDataTypeYes its a public website... I just want to do a automatic login for it... Link to comment Share on other sites More sharing options...
saywell Posted August 1, 2010 Share Posted August 1, 2010 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_InvalidDataTypeYes 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 Link to comment Share on other sites More sharing options...
tokai6 Posted August 1, 2010 Author Share Posted August 1, 2010 (edited) How about _IETagNameGetCollection and then identify the right one in your script?What is the url?WilliamI 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... Edited August 4, 2010 by tokai6 Link to comment Share on other sites More sharing options...
DaleHohm Posted August 2, 2010 Share Posted August 2, 2010 $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 Link to comment Share on other sites More sharing options...
tokai6 Posted August 2, 2010 Author Share Posted August 2, 2010 $oInputs = _IETagnameGetCollection($oIE, "input") For $oInput in $oInputs If String($oInput.className) = "field_login" Then $sName = $oInput.name ConsoleWrite($sName & @CRLF) EndIf Next Dale Thanks Mam/Sir this will do nicely... Problem solved... 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