After a few days of testing and searching and retrying everything I could think of I've decided to finally ask a question.
I have found an iFrame that is being used as a form element. I'm trying to gain control of it and read its html (write to console).
The html source looks like this: (iframe and form highlighted in red)
CODE
<form name="aspnetForm" method="post" action="/Modules/Applications/Pages/Canvas.aspx?appId=104283" id="aspnetForm">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTEyNDc3NTQwNjhkZA==" />
</div>
<script type="text/javascript">
<!--var FIM_advAppId = 104283;var FIM_baseAdvId = null;// -->
</script>
<div id="topLinks" class="clearfix"
<div id="canvasPageTitle">
<img alt="Application Icon" style="vertical-align: bottom;" src="http://a52.ac-images.myspacecdn.com/images01/44/l_b880ac2810ea661ae851b4157f43ede3.png" /><span id="applicationTitle">Mobsters</span>
</div>
<div id="pageLinks" class="right">
<a href='http://apps.myspace.com/Modules/AppGallery/Pages/featuredappgallery.aspx?fuseaction=apps'>MySpace Apps</a> | <a href='http://profileedit.myspace.com/index.cfm?fuseaction=accountSettings.applicationSettings'>View My Apps</a>
</div>
</div>
<script type="text/javascript">
if(top != self) top.location = location;
</script>
<iframe id="apppanel_104283_canvas" name="apppanel_104283_canvas" src="http://api.msappspace.com/apprendering/104283/canvas/render.app#qfvA5CsqQAC7H4t26tAvmDftkJdOsgvHzjnMBdKBMLSugbH8oLf91HRanuH%2bns7Gpv1MTwDoByoVvh0CbQDE3g%2frLHPPgcBpK0UuoTPB60U%3d&opensocial_surface=canvas&ownerId=30018896&installState=1&country=US&lang=en" width="100%" height="2850" scrolling="no" frameborder="0" allowtransparency="true" style="border: none; background:transparent;"></iframe><br />
</form>
I have tried gaining control and read the html of this using the following code:
$oForm = _IEFormGetObjByName($oDiv, "aspnetForm")
ConsoleWrite( "--!-!-------------" & @CRLF)
ConsoleWrite( "FORM Unique ID:" & _IEPropertyGet($oForm, "uniqueid") & @CRLF)
ConsoleWrite( "FORM Location URL:" & _IEPropertyGet($oForm, "locationurl") & @CRLF)
ConsoleWrite( "FORM Id:" & $oForm.id & @CRLF)
$oFrame = _IEFrameGetObjByName($oForm, "apppanel_104283_canvas")
ConsoleWrite(_IEBodyReadHTML($oFrame) & @CR)
I have also looped through all frames on the page using the
$oFrame = _IEFrameGetCollection($oIE, X);<---- with X being 1 2 or 3 (3 frames on page)
Both of these give me the same error
I read a bunch of topics on this message board and tried a lot of approaches, for instance I downloaded Debugbar for IE. I found the path to the link that I'm ultimately trying to click is inside this particular iFrame, and the path looks like this (pseudo)
<div id="wrap">
<form name="aspnetform">
<IFRAME id=apppanel_104283>
<DIV name="mainframe">
<DIV> (no name)
<TABLE>
<TD>
<TR>
<SPAN> MY LINK </SPAN>
</TR>
</TD>
</TABLE>
</DIV>
</DIV>
</IFRAME>
</FORM>
</div>
I am hoping for some enlightenment. I really hope I provided enough information too.
Cheers,
Goat.
- Instant Edit -
I also used this example script:
CODE
#include <IE.au3>
_IEErrorHandlerRegister()
$oIE = _IEAttach("MySpace - Windows Internet Explorer", "WindowTitle", 1)
Sleep(3000)
WinActivate("MySpace - Windows Internet Explorer")
;_IELinkClickByText ($oIE, "My Mob")
Sleep(2000)
$colFrames = _IEFrameGetCollection($oIE)
$iFrameCnt = @extended
ConsoleWrite("There are " & $iFrameCnt & " frames." & @LF)
For $i = 0 To $iFrameCnt - 1
$oFrame = _IEFrameGetCollection($oIE, $i)
MsgBox(0, 0, "Frame " & $i & ":" & _IEBodyReadHTML($oFrame) & @LF)
Next
MsgBox(0, 0, $i)
It produced the same error.