sammy1983

Element name in bracket

31 posts in this topic

Hi All,

I am unable to set any text in text box

<input type="text" class="bginput" name="user[username]" tabindex="1" size="35">

There are other textboxes as well with the same "type", "class", "tabindex" and "size". Hence I am unable to make the script identify this textbox. The script is unable to identify the textbox with the "name". I tried all the combination for "name".

Please help.

Share this post


Link to post
Share on other sites



Show how you try to do this.

 


ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button:

Spoiler

Last update: 2016-12-23
Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft Components * TeamViewer API -UDF * JavaManagement UDF * VIES over SOAPPOP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF * WinSCP UDF *

My contribution to others projects: * _sql.au3 UDF  *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities *

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, The Art of Computer Programming
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Show how you try to do this.

 

Local $oInputs = _IETagNameGetCollection($oIE1, "input")
For $oInput In $oInputs
    If $oInput.type = "text" And $oInput.tabIndex = "1" Then
        _IEFormElementSetValue($oInput, "America")
    EndIf
    ExitLoop
Next

There are few other textboxes with the below code, just the name changes.

<input type="text" class="bginput" name="user[email]" id="it_user[email]_3" value="" size="35" dir="ltr" tabindex="1">

Everything remains same as the above text box except the name and I am unable to use this name methodology to identify this text box. Any help?

Edited by sammy1983

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Did you try this kind of code:

Local $oInputs = _IETagNameGetCollection($oIE1, "input")
For $oInput In $oInputs
    If StringInStr($oInput.outerHTML,'name="user[username]') Then
        _IEFormElementSetValue($oInput, "America")
    EndIf
    ExitLoop
Next

 

Edited by mLipok

ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button:

Spoiler

Last update: 2016-12-23
Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft Components * TeamViewer API -UDF * JavaManagement UDF * VIES over SOAPPOP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF * WinSCP UDF *

My contribution to others projects: * _sql.au3 UDF  *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities *

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, The Art of Computer Programming
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

 

Share this post


Link to post
Share on other sites

:) I do not focus on that at first look

but your ExitLoop was used just in first element.

Try this:

Local $oInputs = _IETagNameGetCollection($oIE1, "input")
For $oInput In $oInputs
    If StringInStr($oInput.outerHTML,'name="user[username]') Then
        _IEFormElementSetValue($oInput, "America")
        ExitLoop
    EndIf
Next

 


ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button:

Spoiler

Last update: 2016-12-23
Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft Components * TeamViewer API -UDF * JavaManagement UDF * VIES over SOAPPOP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF * WinSCP UDF *

My contribution to others projects: * _sql.au3 UDF  *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities *

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, The Art of Computer Programming
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

 

Share this post


Link to post
Share on other sites

:) I do not focus on that at first look

but your ExitLoop was used just in first element.

Try this:

Local $oInputs = _IETagNameGetCollection($oIE1, "input")
For $oInput In $oInputs
    If StringInStr($oInput.outerHTML,'name="user[username]') Then
        _IEFormElementSetValue($oInput, "America")
        ExitLoop
    EndIf
Next

 

Nope mLipok. Same result. Text is not appearing in text box. I don't question your ability but jus clarifying the below code. I don't see closing " in the code. Is that format correct?

'name="user[username]'

 

Share this post


Link to post
Share on other sites

Maybe this ?

If $oInput.type = "text" And StringInStr($oInput.name, "username") Then

BTW what says a Msgbox like this : Msgbox(0,"", $oInput.name)  ?

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

I don't see closing " in the code. Is that format correct?

'name="user[username]'

Small imp, there should nothing change if you add this missing character. Just try.

You can use

Local $oInputs = _IETagNameGetCollection($oIE1, "input")
For $oInput In $oInputs
    ConsoleWrite('================================================' & @CRLF)
    ConsoleWrite($oInput.outerHTML & @CRLF)
    If StringInStr($oInput.outerHTML,'name="user[username]"') Then
        _IEFormElementSetValue($oInput, "America")
        ExitLoop
    EndIf
    MsgBox(0, 'TEST', 'Check console output')
Next

 

but I think try again with exactly what @mikell says

ConsoleWrite('=========================' & @CRLF)
Local $oInputs = _IETagNameGetCollection($oIE1, "input")
For $oInput In $oInputs
    If $oInput.type = "text" and StringInStr($oInput.outerHTML,'user[username]') Then
        _IEFormElementSetValue($oInput, "America")
        ConsoleWrite($oInput.outerHTML & @CRLF)
        ExitLoop
    EndIf
Next
ConsoleWrite('=========================' & @CRLF)

as this time you have correctly used ExitLoop

And say what you get in console.

 

EDIT:
Something to read:

http://stackoverflow.com/questions/7946450/why-do-i-use-brackets-in-the-name-attribute-of-input-element

 

Edited by mLipok
second snippet changed + wording

ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button:

Spoiler

Last update: 2016-12-23
Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft Components * TeamViewer API -UDF * JavaManagement UDF * VIES over SOAPPOP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF * WinSCP UDF *

My contribution to others projects: * _sql.au3 UDF  *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities *

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, The Art of Computer Programming
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

 

Share this post


Link to post
Share on other sites

Maybe this ?

If $oInput.type = "text" And StringInStr($oInput.name, "username") Then

BTW what says a Msgbox like this : Msgbox(0,"", $oInput.name)  ?

Thanks Mikell. I used the below code as suggested by you and included another msgbox.

Local $oInputs = _IETagNameGetCollection($oIE1, "input")
For $oInput In $oInputs
    If $oInput.type = "text" And StringInStr($oInput.name, "username") Then
        MsgBox(0, "", $oInput.name)
        _IEFormElementSetValue($oInput, "America")
        MsgBox(0, "", "Success")
        ExitLoop
    EndIf
Next

Msgbox(0,"", $oInput.name)  gave output "vb_login_username" but this is referencing the Username field while logging in. Also, the control comes inside the code this time and I received the "Success" message but the textbox still doesn't show the text. Am I missing anything?

Share this post


Link to post
Share on other sites

Small imp, there should nothing change if you add this missing character. Just try.

You can use

Local $oInputs = _IETagNameGetCollection($oIE1, "input")
For $oInput In $oInputs
    ConsoleWrite('================================================' & @CRLF)
    ConsoleWrite($oInput.outerHTML & @CRLF)
    If StringInStr($oInput.outerHTML,'name="user[username]"') Then
        _IEFormElementSetValue($oInput, "America")
        ExitLoop
    EndIf
    MsgBox(0, 'TEST', 'Check console output')
Next

 

but I think try again with exactly what @mikell says

ConsoleWrite('=========================' & @CRLF)
Local $oInputs = _IETagNameGetCollection($oIE1, "input")
For $oInput In $oInputs
    If $oInput.type = "text" and StringInStr($oInput.outerHTML,'name="username"') Then
        _IEFormElementSetValue($oInput, "America")
        ConsoleWrite($oInput.outerHTML & @CRLF)
        ExitLoop
    EndIf
Next
ConsoleWrite('=========================' & @CRLF)

as this time you have correctly used ExitLoop

And say what you get in console.

 

I used the first set of code and below is the result.

--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
================================================
<input name="url" type="hidden" value="/admincp/user.php?do=modify">
================================================
"C:\Users\samuel\VB.au3" (49) : ==> The requested action with this object has failed.:
ConsoleWrite($oInput.outerHTML & @CRLF)
ConsoleWrite($oInput^ ERROR
->02:00:03 AutoIt3.exe ended.rc:1
+>02:00:03 AutoIt3Wrapper Finished.
>Exit code: 1    Time: 11.5

2nd set of code showed the below result

--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
=========================
=========================
+>02:02:56 AutoIt3.exe ended.rc:0
+>02:02:56 AutoIt3Wrapper Finished.

 

Share this post


Link to post
Share on other sites

Maybe adding

If $oInput.classname = "bginput" and ; etc

This is a true struggle ^^

Share this post


Link to post
Share on other sites

Msgbox(0,"", $oInput.name)  gave output "vb_login_username" 

Because this HTML element have something like this: 

 

<input type="text" class="..." name="vb_login_username" ....>

So 

If .... StringInStr($oInput.name, "username") Then

Catch it...

try to enumerate each Input to console and give it to us using this code:

ConsoleWrite('=========================' & @CRLF)
Local $oInputs = _IETagNameGetCollection($oIE1, "input")
For $oInput In $oInputs
    If $oInput.type = "text" and StringInStr($oInput.outerHTML,'user') Then
        ConsoleWrite($oInput.outerHTML & @CRLF)
        ExitLoop
    EndIf
    ConsoleWrite('=========================' & @CRLF)
Next

 

But before you run it manualy change content of this Input > set it to "ABC123" then focus on other Input element and run above mentioned snippet.

 

 


ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button:

Spoiler

Last update: 2016-12-23
Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft Components * TeamViewer API -UDF * JavaManagement UDF * VIES over SOAPPOP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF * WinSCP UDF *

My contribution to others projects: * _sql.au3 UDF  *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities *

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, The Art of Computer Programming
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

 

Share this post


Link to post
Share on other sites

Because this HTML element have something like this: 

 

<input type="text" class="..." name="vb_login_username" ....>

So 

If .... StringInStr($oInput.name, "username") Then

Catch it...

try to enumerate each Input to console and give it to us using this code:

ConsoleWrite('=========================' & @CRLF)
Local $oInputs = _IETagNameGetCollection($oIE1, "input")
For $oInput In $oInputs
    If $oInput.type = "text" and StringInStr($oInput.outerHTML,'user') Then
        ConsoleWrite($oInput.outerHTML & @CRLF)
        ExitLoop
    EndIf
    ConsoleWrite('=========================' & @CRLF)
Next

 

But before you run it manualy change content of this Input > set it to "ABC123" then focus on other Input element and run above mentioned snippet.

 

 

Here is the output

--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
=========================
=========================
=========================
=========================
=========================
=========================
=========================
=========================
<input name="vb_login_username" tabindex="1" id="vb_login_username" accesskey="u" style="width: 250px; padding-left: 5px; font-weight: bold;" type="text" value="">
+>02:11:25 AutoIt3.exe ended.rc:0
+>02:11:25 AutoIt3Wrapper Finished.
>Exit code: 0    Time: 10.02

 

Share this post


Link to post
Share on other sites

You should remove the Exitloop from mLipok's code before running it

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

I think some fatigue takes me, I overlooked the obvious errors.
Try this:

ConsoleWrite('=========================' & @CRLF)
Local $oInputs = _IETagNameGetCollection($oIE1, "input")
For $oInput In $oInputs
    If $oInput.type = "text" and StringInStr($oInput.outerHTML,'user') Then
        ConsoleWrite($oInput.outerHTML & @CRLF)
        ConsoleWrite('=========================' & @CRLF)
    EndIf
Next


EDIT:
I hope we catch here this:

<input type="text" class="bginput" name="user[username]" tabindex="1" size="35">

EDIT2:
and try this:

_IEFrameGetCollection($oIE1)
MsgBox(0, '', @error)

 

Edited by mLipok

ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button:

Spoiler

Last update: 2016-12-23
Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft Components * TeamViewer API -UDF * JavaManagement UDF * VIES over SOAPPOP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF * WinSCP UDF *

My contribution to others projects: * _sql.au3 UDF  *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities *

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, The Art of Computer Programming
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

 

Share this post


Link to post
Share on other sites

You should remove the Exitloop from mLipok's code before running it

used the below mLipok's code without Exitloop

ConsoleWrite('=========================' & @CRLF)
Local $oInputs = _IETagNameGetCollection($oIE1, "input")
For $oInput In $oInputs
    If $oInput.type = "text" and StringInStr($oInput.outerHTML,'user') Then
        ConsoleWrite($oInput.outerHTML & @CRLF)
    EndIf
    ConsoleWrite('=========================' & @CRLF)
Next

and this is the output

--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
=========================
=========================
=========================
=========================
=========================
=========================
=========================
=========================
<input name="vb_login_username" tabindex="1" id="vb_login_username" accesskey="u" style="width: 250px; padding-left: 5px; font-weight: bold;" type="text" value="">
=========================
=========================
=========================
=========================
=========================
+>02:16:51 AutoIt3.exe ended.rc:0
+>02:16:51 AutoIt3Wrapper Finished.
>Exit code: 0    Time: 10.1

 

Share this post


Link to post
Share on other sites

 

EDIT2:
and try this:

_IEFrameGetCollection($oIE1)
MsgBox(0, '', @error)

 


ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button:

Spoiler

Last update: 2016-12-23
Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft Components * TeamViewer API -UDF * JavaManagement UDF * VIES over SOAPPOP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF * WinSCP UDF *

My contribution to others projects: * _sql.au3 UDF  *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities *

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, The Art of Computer Programming
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

 

Share this post


Link to post
Share on other sites

#19 ·  Posted (edited)

 

Result is 0

Edited by sammy1983

Share this post


Link to post
Share on other sites

#20 ·  Posted (edited)

 

:)

 

#include <IE.au3>
ConsoleWrite('=========================' & @CRLF)
Local $oInputs = Null
Local $oFrames_Coll = _IEFrameGetCollection($oIE1)
ConsoleWrite('$oFrames_Coll = ' & @extended & @CRLF)
If Not @error Then
For $oFrame_enum In $oFrames_Coll
    $oInputs = _IETagNameGetCollection($oFrame_enum, "input")
    For $oInput In $oInputs
        If $oInput.type = "text" and StringInStr($oInput.outerHTML,'user') Then
            ConsoleWrite($oInput.outerHTML & @CRLF)
            ExitLoop
        EndIf
        ConsoleWrite('=========================' & @CRLF)
    Next
Next

 

Edited by mLipok
_IETagNameGetCollection($oFrame_enum, "input")

ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button:

Spoiler

Last update: 2016-12-23
Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft Components * TeamViewer API -UDF * JavaManagement UDF * VIES over SOAPPOP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF * WinSCP UDF *

My contribution to others projects: * _sql.au3 UDF  *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities *

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, The Art of Computer Programming
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

 

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