Sign in to follow this  
Followers 0
narayanjr

IE Help

10 posts in this topic

#include <IE.au3>

$oIE = _IECreate ("www.megaupload.com")
$oForm = _IEFormGetObjByName($oIE, "uploadform")
$oInputFile = _IEFormElementGetObjByName($oForm, "file")
_IEAction($oInputFile, "focus")
$hIE = _IEPropertyGet($oIE, "hwnd")
Sleep(500)
ControlSend($hIE, "", "Internet Explorer_Server1", "abcdefghijklmnopqrstuvwxyz")

It runs fine but for some reason it does not send the entire string.

Every time i run it it sends a different version of that string.

Try 1: "abdghklmnopqrsvwxyz"

Try 2: "befgijlmnoprstvwxy"

Try 3: "abcdghijmnpqrstuvwxyz"

Try 4: "abcdefijklmnoqrstuvwx"

Any idea/reason why? or any way to fix it?

I've tried setting sendkeydelay to max but it doesn't fix it.

Share this post


Link to post
Share on other sites



#include <IE.au3>

$oIE = _IECreate ("www.megaupload.com")
$oForm = _IEFormGetObjByName($oIE, "uploadform")
$oInputFile = _IEFormElementGetObjByName($oForm, "file")
_IEAction($oInputFile, "focus")
$hIE = _IEPropertyGet($oIE, "hwnd")
Sleep(500)
ControlSend($hIE, "", "Internet Explorer_Server1", "abcdefghijklmnopqrstuvwxyz")

It runs fine but for some reason it does not send the entire string.

Every time i run it it sends a different version of that string.

Try 1: "abdghklmnopqrsvwxyz"

Try 2: "befgijlmnoprstvwxy"

Try 3: "abcdghijmnpqrstuvwxyz"

Try 4: "abcdefijklmnoqrstuvwx"

Any idea/reason why? or any way to fix it?

I've tried setting sendkeydelay to max but it doesn't fix it.

The inputs look like this:

<TR>
        
        <input type="hidden" name="UPLOAD_IDENTIFIER" value="1542577551.1186317703">
        <input type="hidden" name="sessionid" value="1542577551.1186317703">

        <td width="3"></td>
        <TD width="360" height="44">
        Select file to send <font style="color: #666666; font-size: 9px; font-weight: normal;">(maximum 500 MB)</font><br />
        <INPUT style="width:357px;" TYPE="file" NAME="file" VALUE="" size="43" class="file" onkeypress="document.uploadform.url.value='';" onkeyup="document.uploadform.url.value='';" onchange="document.uploadform.url.value='';">
        </TD>
    </TR>

What is that 'control' you sending to, "Internet Explorer_Server1"? If it's an input field, why not use _IEFormElementSetValue()?

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

even if its an input you can still use this, try:

#include <IE.au3>
$oIE = _IECreate ("www.megaupload.com", 0, 1, 1, -1)
$oForm = _IEFormGetObjByName($oIE, "uploadform")
$oInputFile = _IEFormElementGetObjByName($oForm, "file")
_IEAction($oInputFile, "focus")
Sleep(500)
ControlSend('MEGAUPLOAD - The leading online storage and file delivery service - Internet Explorer', "", "Internet Explorer_Server1", "abcdefghijklmnopqrstuvwxyz")
ExitoÝ÷ ÛöÛºÖ j)ڲܬj'r¢çÚ-+-¢ÚºÚ"µÍÚ[ÛYIÒQK]LÉÝÂÌÍÛÒQHHÒQPÜX]H
    ][ÝÝÝÝËYYØ]ØYÛÛI][ÝËKKLJBÌÍÛÑÜHHÒQQÜQÙ]ØS[YJ    ÌÍÛÒQK  ][ÝÝØYÜI][ÝÊBÌÍÛÒ[][HHÒQQÜQ[[Y[Ù]ØS[YJ    ÌÍÛÑÜK ][ÝÙ[I][ÝÊBÛY
L
BÒQQÜQ[[Y[Ù][YJ  ÌÍÛÒ[][K    ][ÝØXÙYÚZÛ[ÜÝ]Þ^][ÝÊB^]
Edited by Gif

Share this post


Link to post
Share on other sites

actually you cant use _IEformelementsetvalue() cause ir function returns:

--> IE.au3 Error from function _IEFormElementSetValue, $_IEStatus_InvalidObjectType (Browser securuty prevents SetValue of TYPE=FILE)

so just use the first one

PS:i couldnt edit because the script messes up :)

Share this post


Link to post
Share on other sites

There is Javascript tied to that field for the events onkeypress, onkeyup and onchange... significant processing of every keystroke. Looks like you need to play with keystroke timing (like you do in some game as I understand it).

I tried adding the following before the ControlSend and it appeared to work consistently thereafter:

AutoItSetOption ("SendKeyDownDelay", 15)

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

I got it to work without ControlSend() it works perfect with just Send() it just has to be visible but thats ok

Thanks for your help

Share this post


Link to post
Share on other sites

I got it to work without ControlSend() it works perfect with just Send() it just has to be visible but thats ok

Thanks for your help

but if you do what i and dalehohm said you can have it invisible also, anyway

Share this post


Link to post
Share on other sites

Did you have trouble with SendKeyDownDelay or did you not try? I'd like to see the answer to that here for others that may trip on this topic at a future date witha similar problem.

thanks,

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

o i didnt try SendKeyDownDelay the first time i read that i thought it said SendKeyDelay, I didnt even know that there was a SendKeyDownDelay

and i tried what you said gif but it didnt seem to work

Im gonna try the SendKeyDownDelay now and see if i can get it to work

Share this post


Link to post
Share on other sites

it worked perfectly thank you

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