Sign in to follow this  
Followers 0
shism2

Internet Explorer certain textbox paste

13 posts in this topic

#1 ·  Posted (edited)

I need to create a script which pastes a "code" into a certain textbox (CCBOX)

and then press a button ..... go back and do it again.

I need to create like a loop which inserts a different code everytime into a textbox pretty much.

Edited by shism2

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Hey Dale I see your reading my post and I was looking at your library.I tried compiling your hotmail example and it gives me and error

Line 776

If IsObj ($o_object.elements)Then

If IsObj ($o_object.e^ERROR

Error: Unable to parse line

Edited by shism2

Share this post


Link to post
Share on other sites

Hey Dale I see your reading my post and I was looking at your library.I tried compiling your hotmail example and it gives me and error

Line 776

If IsObj ($o_object.elements)Then

If IsObj ($o_object.e^ERROR

Error: Unable to parse line

<{POST_SNAPBACK}>

Good, glad you found IE.au3

Make certain you have the berta version 3.1.1.63 or higher.

I know you are using the example from the forum, but if you are still having trouble, please post the code and the full output from AutoIt when you run it.

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

C:\Documents and Settings\Owner\Desktop\IE.au3(217,57) : ERROR: ObjCreate(): undefined function.

$o_object = ObjCreate("InternetExplorer.Application")

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\Owner\Desktop\IE.au3(218,23) : ERROR: IsObj(): undefined function.

If IsObj($o_object)

~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\Owner\Desktop\IE.au3(275,39) : ERROR: ObjName(): undefined function.

If (ObjName($o_window.document)

Share this post


Link to post
Share on other sites

C:\Documents and Settings\Owner\Desktop\IE.au3(217,57) : ERROR: ObjCreate(): undefined function.

    $o_object = ObjCreate("InternetExplorer.Application")

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\Owner\Desktop\IE.au3(218,23) : ERROR: IsObj(): undefined function.

    If IsObj($o_object)

~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\Owner\Desktop\IE.au3(275,39) : ERROR: ObjName(): undefined function.

        If (ObjName($o_window.document)

<{POST_SNAPBACK}>

To repeat, Make certain you have the beta version 3.1.1.63 or higher.

ObjCreate and IsObj were introduced in 3.1.1, ObjName in 3.1.1.63

If you want to be certain of you version, place the following in your code:

MsgBox(0, "AutoIt Version", @AutoItVersion)

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

C:\Documents and Settings\Owner\Desktop\IE.au3(275,39) : ERROR: ObjName(): undefined function.

This is what I got now but the program still runs

Share this post


Link to post
Share on other sites

Please look carefully at your output. I'm betting that ISN't what you got... you really got something that said something close to this:

>Running AU3Check...C:\Program Files\AutoIt3\SciTe\Defs\Production\Au3Check\au3check.dat
C:\Documents and Settings\Owner\Desktop\IE.au3(275,39) : ERROR: ObjName(): undefined function.
        If (ObjName($o_window.document)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\your-script-name-here.au3 - 1 error(s), 0 warning(s)
>AU3Check Ended with Error(s).

AU3Check Ended with Error(s). -- Au3Check is a syntax checker, it is not the AutoIt language interpreter.

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

#8 ·  Posted (edited)

Ya thats what I got

Ok Now There is one problem so far implementing the script

For the submit option

******* is for my privacy

#include <IE.au3>

; Create a browser window and navigate to hotmail

$oIE = _IECreate()

_IENavigate($oIE, "************")

; get pointers to the login form and username and password fields

$o_form = _IEFormGetObjByName($oIE, "**********")

$o_CCBox = _IEFormElementGetObjByName($o_form, "CCBox")

; Set field values and submit the form

_IEFormElementSetValue($o_CCBox, "**********")

sleep(1000)

_IEFormSubmit($o_form)

Exit

When the form submits... The page just resets itself. Its supposed to show a message saying code could not be parsed and what not.

I found this in the source

<script>

function doSubmit() {

var input = document.createElement('INPUT');

input.type = "hidden";

input.name = "SubmitBtn";

input.value = "true";

document.******.appendChild(input);

}

function addHiddenElement(name, value) {

var input = document.createElement('INPUT');

input.type = "hidden";

input.name = name;

input.value = value;

document.*******.appendChild(input);

}

function checkKey() {

if (window.event.keyCode == 13) {

doSubmit();

}

return true;

}

<input name="CCBox" type="text" size="40" maxlength="120" onkeypress="return checkKey();"><br><br><br>

<input type="image" name="SubmitBtn" onclick="java script:doSubmit();" value="********" src="http://g-images.*****.com/images/G/01/promotions/**/button-enter-b.gif" width="143" height="35">

Thats the source from the submit button image

I could just use a mouse script to press it.... This looks like some kind of protection for automation ... Is it?

Edited by shism2

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

This type of web coding is pretty common these days. There are a lot of forms that use extra logic instead of simply the Form Submit.

Instead of doing the _IEFormSubmit(), do the following:

$o_SubmitButton = _IEFormElementGetObjByName($o_form, "SubmitBtn")
$o_SubmitButton.click

Dale

Edited by DaleHohm

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

#10 ·  Posted (edited)

C:\Documents and Settings\Owner\Desktop\*******.au3 (16) : ==> Variable must be of type "Object".:

$o_SubmitButton.click

$o_SubmitButton^ ERROR

Sry I just started using Autoit today..... Sry If Im bothering you :whistle:

Edited by shism2

Share this post


Link to post
Share on other sites

C:\Documents and Settings\Owner\Desktop\*******.au3 (16) : ==> Variable must be of type "Object".:

$o_SubmitButton.click

$o_SubmitButton^ ERROR

Sry I just started using Autoit today..... Sry If Im bothering you  :whistle:

<{POST_SNAPBACK}>

Ugggh. It's difficult without being able to test against what you are using. I imagine that if you checked the value of $o_SubmitButton it would be 0, indicating a failure.

You can try this:

$o_SubmitButton = $oIE.document.getElementById("SubmitBtn")
$o_SubmitButton.click

If that fails, please try to find a generic internet site is similar characteristics that you can test with and share your results here... THat way I can figure out something that works instead of saying "try this".

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

Great IT WORKED Thanks alot DAVE

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

Hi,

If you look at my general Web Login script, I know that it works for a number of types of site, including Hotmail and Yahoo, with a workaround for difficult submit sites.

It also finds some sites which use iframes for their passwords, probably not others. it does not work for unusual extra forms using javascript to open another form for the password (unless well-marked as iframe)

Best, randall

cf in my signature link;

WebLogin

Edited by randallc

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