Jump to content

getting <input ID > into IE code


Recommended Posts

I read whole function of IE ...... but i am not able to find OR I am not ever seen ...and i am still confused because i not find how to write this in <IE>

<INPUT id=the_file type=file size=25 name=the_file jQuery1248433129687="25">

please give me hint ..it is possible in Autoit to use INPUT id = ........ which i read ... i only find IEFormElementGetCollection ,_IEFormElementGetObjByName ,_IEFormElementGetValue

Link to comment
Share on other sites

Take a look at _IETagNameGetCollection

for example:

#include <ie.au3>

$oIE = _IECreate("www.google.com", 0, 0, 1, 1)
$oInputs = _IETagNameGetCollection($oIE, "Input")
    For $oInput in $oInputs
        consolewrite(string($oInput.id) & @CRLF)
    Next
Link to comment
Share on other sites

Thanks for your response ...it was very helpful for me ..... using above example i find this code ...

$oForm = _IEFormGetObjByName ($oIE, "uploadForm")

$oQuery = _IEFormElementGetObjByName ($oForm, "the_file")

please correct me if i doing right

<INPUT id=the_file type=file size=25 name=the_file jQuery1248450651078="25">

<FORM id=uploadForm

complete code

<FORM id=uploadForm name=uploadForm action=http://s3.tinypic.com/upload.php method=post target=upload_iframe encType=multipart/form-data jQuery1248450651078="99" sizcache="0" sizset="8"><INPUT id=uid type=hidden value=541949491_1248450652 name=UPLOAD_IDENTIFIER jQuery1248450651078="19"> <INPUT type=hidden value=2eee7148e644baec45a8de649af5b64a name=upk jQuery1248450651078="20"> <INPUT type=hidden value=en name=domain_lang jQuery1248450651078="21"> <INPUT type=hidden value=upload name=action jQuery1248450651078="22"> <INPUT type=hidden value=500000000 name=MAX_FILE_SIZE jQuery1248450651078="23"> <INPUT type=hidden value=true name=shareopt jQuery1248450651078="24">

<DIV id=uploadfile sizcache="0" sizset="14"><LABEL for=the_file>File:</LABEL> <INPUT id=the_file type=file size=25 name=the_file jQuery1248450651078="25"> </DIV>

<DIV id=uploadurl style="DISPLAY: none" sizcache="0" sizset="15"><LABEL for=the_url>Url:</LABEL> <INPUT id=the_url size=40 name=url jQuery1248450651078="26"> </DIV>

<DIV sizcache="0" sizset="16"><LABEL for=description>Tags:</LABEL> <INPUT class=input-text id=description maxLength=250 size=25 name=description jQuery1248450651078="27"> <SPAN><STRONG>Ex:</STRONG> <A href="http://tinypic.com/search.php?type=images&amp;tag=truck" jQuery1248450651078="28">Truck</A>, <A href="http://tinypic.com/search.php?type=images&amp;tag=dodge%20ram" jQuery1248450651078="29">Dodge Ram</A></SPAN> </DIV>

<DIV class=radio sizcache="0" sizset="17"><LABEL>File Type:</LABEL>

<UL sizcache="0" sizset="17">

<LI sizcache="0" sizset="17"><INPUT class=input-radio id=file_type_image type=radio CHECKED value=image name=file_type jQuery1248450651078="30"> <LABEL for=file_type_image>Image</LABEL>

<LI sizcache="0" sizset="18"><INPUT class=input-radio id=file_type_video type=radio value=video name=file_type jQuery1248450651078="31"> <LABEL for=file_type_video>Video</LABEL>

<LI sizcache="0" sizset="19"><INPUT class=input-radio id=file_type_url type=radio value=url name=file_type jQuery1248450651078="32"> <LABEL for=file_type_url>Url</LABEL> </LI></UL></DIV>

<DIV id=resize><LABEL for=dimension>Resize:</LABEL> <SELECT id=dimension name=dimension> <OPTION value=1600 selected>Default</OPTION> <OPTION value=100>Avatar (100x75)</OPTION> <OPTION value=160>Thumbnail (160x120)</OPTION> <OPTION value=320>Website/Email (320x240)</OPTION> <OPTION value=640>Message Board (640x480)</OPTION> <OPTION value=800>15" Screen (800x600)</OPTION> <OPTION value=1024>17" Screen (1024x768)</OPTION></SELECT> </DIV>

<DIV id=video-options style="DISPLAY: none"><LABEL for=video-settings>Settings:</LABEL> <SELECT id=video-settings name=video-settings> <OPTION value=sd selected>Standard Definition</OPTION> <OPTION value=hd>High Definition</OPTION></SELECT> </DIV>

<DIV sizcache="0" sizset="20"><LABEL for=email>Share:</LABEL>

<DIV id=emaildiv sizcache="0" sizset="20"><INPUT id=emailsharebox type=checkbox jQuery1248450651078="33">Send it Via E-Mail</DIV>

<DIV id=emailinput style="DISPLAY: none" sizcache="0" sizset="21"><INPUT id=email-img maxLength=250 size=25 name=addresses jQuery1248450651078="34"><BR>Use commas to separate e-mail addresses.</DIV></DIV><BUTTON class="large green button" onclick="buttonTracker._trackEvent('Upload', 'Public');" type=submit>Upload Now!</BUTTON>

<P class=upload-warning>Nothing offensive, please!</P></FORM>

Edited by whiteegg
Link to comment
Share on other sites

You can shorten by doing:

$oQuery = _IEGetObjById ($oIE, "the_file")

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

by the way i write this code but nothing happened

#include <IE.au3>  $oIE = _IECreate ("http://tinypic.com/?t=postupload") $oQuery = _IEGetObjById ($oIE, "the_file") _IEFormElementSetValue ($oQuery, "c:\mypic.jpg")

#include <IE.au3>

$bak = ClipGet()

$oIE = _IECreate ("http://tinypic.com/?t=postupload")

$oQuery = _IEGetObjById ($oIE, "the_file")

_IEFormElementSetValue ($oQuery, "AutoIt IE.au3")

Edited by whiteegg
Link to comment
Share on other sites

Hi whiteegg,

To use the _IEFormElement... you have to bind the Form to an object first.

So like this.

#include <IE.au3>
$bak = ClipGet()
$oIE = _IECreate("http://tinypic.com/?t=postupload", 0, 1, 1, 1)
$oForm = _IEFormGetCollection ($oIE, 2) ; it is the 3rd form on the page
$oQuery = _IEGetObjById ($oForm, "the_file")
_IEAction($oQuery, "focus")
Send("C:\mypic.jpg")

Check the examples in the helpfile under _IEFormElementSetValue if you want it to run in the background.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...