JamieO 0 Posted October 8, 2007 (edited) Hi guys, this is my first post. I am new to autoit and am looking at getting help with filling out forms that are frames. Most of my background in programming is in computational physics, so i have very little experience in application development and even less in scripting and web development.Basically i am looking at how one would use the IE.au3 functions to login to a site like this that uses frames: http://www.thegreek.com/sports/home.asp. I understand and have used the _IEFormGetCollection and _IEFormElementGetObjByName functions to create an auto-login program for another site, but i dont really get how to use the _IEFrameGetCollection, and _IEFrameGetObjByName. I dont know how to get the name of an object in a frame. Are there tools for such things? Any help would be greatly appreciated. Edited October 8, 2007 by JamieO Share this post Link to post Share on other sites
Josbe 1 Posted October 8, 2007 Hi guys, this is my first post. I am new to autoit and am looking at getting help with filling out forms that are frames. Most of my background in programming is in computational physics, so i have very little experience in application development and even less in scripting and web development.Basically i am looking at how one would use the IE.au3 functions to login to a site like this that uses frames: http://www.thegreek.com/sports/home.asp. I understand and have used the _IEFormGetCollection and _IEFormElementGetObjByName functions to create an auto-login program for another site, but i dont really get how to use the _IEFrameGetCollection, and _IEFrameGetObjByName. I dont know how to get the name of an object in a frame. Are there tools for such things? Any help would be greatly appreciated.I think this tool maded by Valuater, could help you: IE builder. AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta Share this post Link to post Share on other sites
DaleHohm 65 Posted October 8, 2007 IE Builder would help. So would this modification to the example for _IEFrameGetCollection to get frame names: #include <IE.au3> $oIE = _IE_Example ("frameset") $oFrames = _IEFrameGetCollection ($oIE) $iNumFrames = @extended For $i = 0 to ($iNumFrames - 1) $oFrame = _IEFrameGetCollection ($oIE, $i) MsgBox(0, "Frame Info", $oFrame.name) Next Also, strongly recomment the free DebugBar in my sig to get you going faster. Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curlMSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object modelAutomate input type=file (Related)Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better?IE.au3 issues with Vista - WorkaroundsSciTe 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
JamieO 0 Posted October 8, 2007 Thanks guys, that DebugBar is an awesome tool, i just installed it and have started playing around with it. It will definetly help me figure this out. Share this post Link to post Share on other sites
JamieO 0 Posted October 9, 2007 so i got it to work using the basic form of an autoit login i found on here somewhere, i had a few questions about the code though if anyone can anwser. CODE #include <IE.au3> $TGID="guest" $TGPass="guest" $oTimeout=5000 TGlogin ($TGID, $TGPass, $oTimeout) Func TGLogin ($TGID, $TGPass, $oTimeout) Global $oIE, $oFrame, $oName, $opass, $otimer, $oForm _IELoadWaitTimeout($oTimeOut) ;sets timeout in milliseconds (5000=5seconds) why is timeout necessary? _IEErrorHandlerRegister() ; registers the default IE.au3 com error handler what does this mean? $oIE = _IECreate("http://www.thegreek.com/sports/home.asp") $oFrame = _IEFrameGetObjByName ($oIE, "main") $oForm = _IEFormGetCollection($oFrame, 0) $oName = _IEFormElementGetObjByName($oForm, "username") $oPass = _IEFormelementgetobjbyname($oForm, "password") _IEFormElementSetValue($oName, $TGID) _IEFormElementSetValue($opass, $TGPass) _IEFormSubmit ($oForm) $Timer = TimerInit() Do Sleep(1) Until _IEPropertyGet($oIE, "locationurl") = "http://www.thegreek.com/sports/home.asp" Or TimerDiff($Timer) > $oTimeOut ; what does this do??? _IEErrorHandlerDeRegister() EndFunc Share this post Link to post Share on other sites
DaleHohm 65 Posted October 9, 2007 What you have is likely more complicated taht it needs to be. This is all you should need: #include <IE.au3> $oIE = _IECreate("http://www.thegreek.com/sports/home.asp") $oFrame = _IEFrameGetObjByName ($oIE, "main") $oForm = _IEFormGetCollection($oFrame, 0) $oName = _IEFormElementGetObjByName($oForm, "username") $oPass = _IEFormelementgetobjbyname($oForm, "password") _IEFormElementSetValue($oName, $TGID) _IEFormElementSetValue($opass, $TGPass) _IEFormSubmit ($oForm)oÝ÷ Øò¢èZ½ëk¢æå{Ø^ Ah®d®nh±çêÞªä{az¥¥ø¥yú+¶~éܶ*'êeiÇ¢·«¢+Ù}%½ÉµMÕµ¥Ð ÀÌØí½½É´°À¤)}%1½]¥Ð ÀÌØí½Éµ¤ or if the frame disappears as a result of the submitted form, replace the last $oFrame with $oIE Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curlMSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object modelAutomate input type=file (Related)Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better?IE.au3 issues with Vista - WorkaroundsSciTe 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