Jump to content

ie : fill box without name but with id


MrPook
 Share

Recommended Posts

Hello,

i'm using a tool which is very tricky.

In fact, it creates it's own webpages so some boxes to fill will have allways the same id, but a different name each time (with rand number inside) which is difficult to me ...

<INPUT id=fakeName name=##0!3!simpleSearch!1247629!*:):*!$1!1!">

I tried this code

$oDiv = _IEGetObjById ($oIE, "fakeName")

_IEFormElementSetValue ($oDiv, "hi_there")

but it wont work, i dont know how to solve it ...

(in fact i used to work with fixed names and forms :

$oForm = _IEFormGetObjByName ($oIE, $form)

$oText = _IEFormElementGetObjByName ($oForm, $var_name)

_IEFormElementSetValue ($oText, $value)

but i dont have forms now)

Thanks in advance

Mr Pook

Link to comment
Share on other sites

Is it an INPUT element or a DIV?

If it is a DIV you can use _IEPropertySet($oDIV, "innertext", new-string)

If it is an INPUT element, it is important to know what the TYPE= value is

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

Is it an INPUT element or a DIV?

If it is a DIV you can use _IEPropertySet($oDIV, "innertext", new-string)

If it is an INPUT element, it is important to know what the TYPE= value is

Dale

the element seems to be a INPUT only : i just make some simplifications in the code generated and here it is :

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html><head><title>Rechercher</title>

<tr><td class="lr1">Nom:</td><td class="lr2"><INPUT id = "fakeName" TYPE="text" NAME="##0!3!com.enterprise.search:simpleFrame.simpleSearch!1595423!property.fakeName" VALUE=""></td><td class="lr1">Numéro:</td><td class="lr2"><INPUT id = "fakeNumber" TYPE="text" NAME="##0!3!com.enterprise.search:simpleFrame.simpleSearch!property.fakeNumber" VALUE=""></td></tr>

</body></html>

as you can see, ids are pretty simple, but NAMES aren't at all (and i cut most part of them)

thanx in advance for your help

Edited by MrPook
Link to comment
Share on other sites

With this HTML, the code in your basenote should work... unless there are other elements on the page that also have an id="fakeName". If this is the case, the DOM will be confused because it requires that ID's are unique. You can still work around that by using _IETagNameGetCollection($oIE, "input", 0-based-index).

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

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...