Jump to content

Get a Form with out name...


Recommended Posts

I take your trying to login into http://www.arto.dk/ ? If so use the form id of 0

document.all.mainFrame.all.topFrame.forms.item(0).brugernavn <---- Name textbox referance

You may have some trouble with the frames also

That should push you in right direction

Firefox's secret is the same as Jessica Simpson's: its effortless, glamorous style is the result of — shhh — extensions!

Link to comment
Share on other sites

Using IE.au3, see _IEFormGetCollection with a 0-based index. If there are frames, see _IEFrameGetObjByName.

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

Could you give a example. Seems no matter what I do, gives me the "IE.au3 Warning from function _IEFormGetCollection, $_IEStatus_NoMatch" error.

#include <IE.au3>
$oIE = _IECreate ("http://www.arto.dk")
$oForm = _IEFormGetCollection ($oIE, 0)
$oQuery = _IEFormElementGetCollection ($oForm, 1)
_IEFormElementSetValue ($oQuery, "test")

I tried this one too. Same error.

document.all.mainFrame.all.topFrame.forms.item(0).brugernavn

^ What means that? And where to put it?

Sorry but I'm a kind of slow :">

Thank you :whistle:

Link to comment
Share on other sites

This site is just nuts with frames. This should get you closer, but the $Frame2 includes at least 10 iFrames... you'll need to dig to figure out what what you want is hidden.

#include <IE.au3>
$oIE = _IECreate ("http://www.arto.dk", 1)
$oFrame = _IEFrameGetObjByName($oIE, "mainframe")
$oFrame2 = _IEFrameGetObjByName($oFrame, "hovedside")

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

This site is just nuts with frames. This should get you closer, but the $Frame2 includes at least 10 iFrames... you'll need to dig to figure out what what you want is hidden.

#include <IE.au3>
$oIE = _IECreate ("http://www.arto.dk", 1)
$oFrame = _IEFrameGetObjByName($oIE, "mainframe")
$oFrame2 = _IEFrameGetObjByName($oFrame, "hovedside")oÝ÷ Ø6¥{ú®¢×¢)ìµçh~­¶)ඨn7¶v¦x!jYm¯+h~)ݶ­©Â+a¶®±êçjgÚZ²Ì(­ÕU,z¹Úæ§tö¬³
+v+"«¨¶/yÛ"uꮢÓhÂØZ´Z½è§²×ا'(u譲إ¯zÉiê뢳h~¶¦zɵÈb    Úå¡jÒÛh~)ݶ­©©F(!µÉbrB'*Þ~hÚ)~¶¦{­ë®v¦y©Ý¥«,ÂÝjwlzWµçO®^+*+¯'hmz0­جq©eyاzx%ÈjºN¥éìxh½çlתºb¶Æ¢t8!Ú,¢g­)àº'«­¢+Ø¥¹±Õ±Ðí%¹ÔÌÐì(ÀÌØíÍUÍɹµôÅÕ½ÐíUÍɹµÅÕ½Ðì(ÀÌØíÍAÍÍݽÉôÅÕ½ÐíAÍÍݽÉÅÕ½Ðì(ÀÌØíÍUÉ°ôÅÕ½Ðí¡ÑÑÀè¼½ÝÝܹÉѼ¹¬ÅÕ½Ðì(ÀÌØí½%ô}%
ÉÑ ÀÌØíÍUÉ°°À°Ä°Ä¤(ÀÌØí½½É´ô}%ɵÑ=©    å9µ ÀÌØí½%°ÅÕ½Ðí¡½ÙÍ¥ÅÕ½Ðì¤(ÀÌØí½UÍɹµô}%½Éµ±µ¹ÑÑ=©  å9µ ÀÌØí½½É´°ÅÕ½ÐíÉÕɹٸÅÕ½Ðì¤(ÀÌØí½AÍÍݽÉô}%½Éµ±µ¹ÑÑ=© å9µ ÀÌØí½½É´°ÅÕ½Ðí­½½ÉÅÕ½Ðì¤)}%½Éµ±µ¹ÑMÑY±Õ ÀÌØí½UÍɹµ°ÀÌØíÍUÍɹµ¤)}%½Éµ±µ¹ÑMÑY±Õ ÀÌØí½AÍÍݽɰÀÌØíÍAÍÍݽɤ

Thank you :whistle:

EDIT: After I have look at _IEFrameGetObjByName in the help file and your post again, I have a question; does _IEFrameGetObjByName return a array?

Edited by Mr. Zero
Link to comment
Share on other sites

$oForm = _IEFrameGetObjByName($oIE,"hovedside")

This returns a Frame, not a form. You need to look for the form inside the frame, the formelement inside a form.

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

$oForm = _IEFrameGetObjByName($oIE,"hovedside")

This returns a Frame, not a form. You need to look for the form inside the frame, the formelement inside a form.

Dale

Thanks.

Now that I have the frame, I need the form.

This gives me a error, I can't see why...

#include <IE.au3>
$sUsername = "Username"
$sPassword = "Password"
$sUrl = "http://www.arto.dk"
$oIE = _IECreate ($sUrl,0,1,1)
$oFrame = _IEFrameGetObjByName($oIE, "mainframe")
$oFrame2 = _IEFrameGetObjByName($oFrame, "hovedside")
$oForm = _IEFormElementGetCollection($oFrame2, 1)
$oUsername = _IEFormElementGetObjByName ($oForm, "brugernavn")
$oPassword = _IEFormElementGetObjByName ($oForm, "kodeord")
_IEFormElementSetValue ($oUsername, $sUsername)
_IEFormElementSetValue ($oPassword, $sPassword)

It is _IEFormElementGetCollection I shall use for getting the form?

Link to comment
Share on other sites

Nope :whistle: _IEFormGetCollection - FormElements live inside forms.

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

Nope :whistle: _IEFormGetCollection - FormElements live inside forms.

Dale

Hmm...

#include <IE.au3>
$sUsername = "Username"
$sPassword = "Password"
$sUrl = "http://www.arto.dk"
$oIE = _IECreate ($sUrl,0,1,1)
$oFrame = _IEFrameGetObjByName($oIE, "mainframe")
$oFrame2 = _IEFrameGetObjByName($oFrame, "hovedside")
$oForm = _IEFormGetCollection($oFrame2, 1)
$oUsername = _IEFormElementGetObjByName ($oForm, "brugernavn")
$oPassword = _IEFormElementGetObjByName ($oForm, "kodeord")
_IEFormElementSetValue ($oUsername, $sUsername)
_IEFormElementSetValue ($oPassword, $sPassword)

Error: "IE.au3 Warning from function _IEFormGetCollection, $_IEStatus_NoMatch"

No Match?

Link to comment
Share on other sites

I looked at the source of hovedside and there are NO forms included... (you can ConsoleWrite(_IEBodyReadHTML($oFrame2))

THere are 10+ frames embedded there however so your work of drilling into frames to find what you need is probably not node.

Another possibility is that some sites play games with using iFrames instead of form elements and there are other creative techniques as well. Unfortunately you'll just have to dig... I don't have time to take it any further - perhaps someone else will be willing to start digging through the frames with you.

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

I looked at the source of hovedside and there are NO forms included... (you can ConsoleWrite(_IEBodyReadHTML($oFrame2))

THere are 10+ frames embedded there however so your work of drilling into frames to find what you need is probably not node.

Another possibility is that some sites play games with using iFrames instead of form elements and there are other creative techniques as well. Unfortunately you'll just have to dig... I don't have time to take it any further - perhaps someone else will be willing to start digging through the frames with you.

Dale

Thank you very much Dale :D.

I think I have misunderstanded the _IEFormGetCollection function. What does it return? Array?

Yes, there is alot of frames on the site and no names on them :whistle:.

And iFrame? Is that a array slot from _IEFormGetCollection?

If there is +10 frames how do I get one of them? What is the command/function?w

Current Code:

#include <IE.au3>
$sUsername = "Username"
$sPassword = "Password"
$sUrl = "http://www.arto.dk"
$oIE = _IECreate ($sUrl,0,1,1)
$oFrame = _IEFrameGetObjByName($oIE, "mainframe")
$oFrame2 = _IEFrameGetObjByName($oFrame, "hovedside")
$oForm = _IEFormGetCollection($oFrame2, 1)
$oUsername = _IEFormElementGetObjByName ($oForm, "brugernavn")
$oPassword = _IEFormElementGetObjByName ($oForm, "kodeord")
_IEFormElementSetValue ($oUsername, $sUsername)
_IEFormElementSetValue ($oPassword, $sPassword)

Anyone there can explain furter and how to?

Thank you :P

Link to comment
Share on other sites

A collectio is similar to an Array in some ways, but it is an object-oriented concept. A collection has members and properties and the members have their own properties and methods... sorry if this is confusing, but once you understand OO the same concepts are used everywhere.

_IExxxxGetCollection allows you to either get a collection that you can loop through with For...In...Next or you can get a specific member from it by using the index parameter (note that the index starts with 0). You can see haw many members are in the collection by examining @extended after calling _IExxxxGetCollection (or by using the .length property of the collection).

So, both Frames and iFrames are accessed through _IEFrameGetCollection -- you'll probably want to use the index since they have no names.

note however that you cannot use For...In...Next with the Frame collection -- don't know why, but there is an example of how to loop in the helpfile.

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