Kinhow Posted December 3, 2005 Share Posted December 3, 2005 is there a way to get the code of an iframe using the dales code? $oIE = _IECreate() _IENavigate($oIE, "http://www.autoitscript.com/") $body = _IEBodyReadHTML($oIE) what i want i to check if something i want is writen on the iframe of this $oIE note: there are more than 1 iframe. maybe _IEFrameGetCollection(), but i couldnt make it work.... Link to comment Share on other sites More sharing options...
Valuater Posted December 3, 2005 Share Posted December 3, 2005 just look at the file and you will know if its there $oIE = _IECreate() _IENavigate($oIE, "http://www.autoitscript.com/") $sBody = _IEBodyReadHTML($oIE) Run("notepad.exe") WinWaitActive("") sleep(1000) ;ClipGet($sBody) ClipPut($sBody) Send("^V") 8) Link to comment Share on other sites More sharing options...
DaleHohm Posted December 3, 2005 Share Posted December 3, 2005 There has been some confusion with iFrames and I'm still not certain whether there are issues with the way I am enumerating them in IE.au3 or not (I haven't put aside the uninterrupted time to work through all the angles yet)... I have a test setup with a frameset in a typical configuration with a left, top and main frame.<html> <head> <title>frameset</title> </head> <frameset cols="150,*"> <frame name="left" scrolling="no" noresize target="top" src="left.htm"> <frameset rows="20%,*"> <frame name="top" target="bottom" src="top.htm"> <frame name="main" src="main.htm" target="_self"> </frameset> <noframes> <body> <p>This page uses frames, but your browser doesn't support them.</p> </body> </noframes> </frameset> </html> The main frame includes an iFrame named I1:<html> <head> <title>Main</title> </head> <body bgcolor="#FFFF00"> <p>Main</p> <p><iframe name="I1" src="iframe.htm"> Your browser does not support inline frames or is currently configured not to display inline frames. </iframe></p> </body> </html> In this configuration I can access the content of the iFrame as follows (where $oIE is the reference to the main browser created with _IECreate() ):$oFrameMain = _IEFrameGetObjByName($oIE, "main") $oFrameIframe = _IEFrameGetObjByName($oFrameMain, "I1") ConsoleWrite(_IEBodyReadHTML($oFrameIframe) & @CR) I presume that your use of www.autoitscript.com was just an example URL righ? as there are no iFrames there. Does this help? 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 More sharing options...
AutoDave Posted December 3, 2005 Share Posted December 3, 2005 Dave, how do you access the iFrame, if the iFrame doesn't have a name? Index? Cheers, Dave There has been some confusion with iFrames and I'm still not certain whether there are issues with the way I am enumerating them in IE.au3 or not (I haven't put aside the uninterrupted time to work through all the angles yet)... I have a test setup with a frameset in a typical configuration with a left, top and main frame.<html> <head> <title>frameset</title> </head> <frameset cols="150,*"> <frame name="left" scrolling="no" noresize target="top" src="left.htm"> <frameset rows="20%,*"> <frame name="top" target="bottom" src="top.htm"> <frame name="main" src="main.htm" target="_self"> </frameset> <noframes> <body> <p>This page uses frames, but your browser doesn't support them.</p> </body> </noframes> </frameset> </html> The main frame includes an iFrame named I1:<html> <head> <title>Main</title> </head> <body bgcolor="#FFFF00"> <p>Main</p> <p><iframe name="I1" src="iframe.htm"> Your browser does not support inline frames or is currently configured not to display inline frames. </iframe></p> </body> </html> In this configuration I can access the content of the iFrame as follows (where $oIE is the reference to the main browser created with _IECreate() ):$oFrameMain = _IEFrameGetObjByName($oIE, "main") $oFrameIframe = _IEFrameGetObjByName($oFrameMain, "I1") ConsoleWrite(_IEBodyReadHTML($oFrameIframe) & @CR) I presume that your use of www.autoitscript.com was just an example URL righ? as there are no iFrames there. Does this help? Dale KeeForm Link to comment Share on other sites More sharing options...
DaleHohm Posted December 3, 2005 Share Posted December 3, 2005 Dave, how do you access the iFrame, if the iFrame doesn't have a name? Index? Cheers, DaveYes, by index. In my example, either of these will work:$oFrameIframe = _IEFrameGetObjByName($oFrameMain, "I1") or $oFrameIframe = _IEFrameGetObjByIndex($oFrameMain, 0) 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 More sharing options...
Kinhow Posted December 11, 2005 Author Share Posted December 11, 2005 well dale, the code you psted isnt working, actually i change it for a try and i couldnt make it... the i copy pasted your code and it still does not work... $oFrameMain = _IEFrameGetObjByName($oIE, "main") $oFrameIframe = _IEFrameGetObjByName($oFrameMain, "I1") in my example, i have an index with iframes named "big" and one above named "small", how can i get the source of the iframe "small" ? this is not working: $oFrameMain = _IEFrameGetObjByName($oIE, "main") $oFrameIframe = _IEFrameGetObjByName($oFrameMain, "small") Link to comment Share on other sites More sharing options...
DaleHohm Posted December 11, 2005 Share Posted December 11, 2005 well dale, the code you psted isnt working, actually i change it for a try and i couldnt make it... the i copy pasted your code and it still does not work... $oFrameMain = _IEFrameGetObjByName($oIE, "main") $oFrameIframe = _IEFrameGetObjByName($oFrameMain, "I1") in my example, i have an index with iframes named "big" and one above named "small", how can i get the source of the iframe "small" ? this is not working: $oFrameMain = _IEFrameGetObjByName($oIE, "main") $oFrameIframe = _IEFrameGetObjByName($oFrameMain, "small")The code I posted certainly worked here. You'll need to either point to a sample location that you are having trouble with on the Internet or you'll need to create a full example and post your code -- your description [i have an index with iframes named "big" and one above named "small"] is too ambiguous to work with. 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now