Jester009 Posted October 1, 2008 Share Posted October 1, 2008 (edited) Hi guys, I'm trying to access the IFRAMES of the following URL. But I get an error. Can anybody please explain what's going on? $oIE = _IECreate("http://www.quickonlinetips.com/archives/2008/08/adsense-ads-below-post-title/") $oFrames = _IEFrameGetCollection ($oIE) $iNumFrames = @extended For $i = 0 to ($iNumFrames - 1) $oFrame = _IEFrameGetCollection ($oIE, $i) MsgBox(0, "Frame Info", _IEPropertyGet ($oFrame, "locationurl")) Next I get this error... D:\Program Files\AutoIt3\Include\IE.au3 (3140) : ==> The requested action with this object has failed.: Return $o_object.location.href() Return $o_object.location.href()^ ERROR ??? Edited October 1, 2008 by Jester009 Link to comment Share on other sites More sharing options...
DaleHohm Posted October 1, 2008 Share Posted October 1, 2008 Add _IEErrorHandlerRegister() near the top of your code. If you get an Access is Denied error, you have a cross-domain security error. Only work around is to open the src of the crame in a new window. 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...
Jester009 Posted October 1, 2008 Author Share Posted October 1, 2008 Hi Dale, Thanks for the advice. How do I open the frame in a new window? Link to comment Share on other sites More sharing options...
Jester009 Posted October 1, 2008 Author Share Posted October 1, 2008 I get the Access is denied error. How do I open the source in another window? Any help is appreciated... Link to comment Share on other sites More sharing options...
DjDeep00 Posted October 1, 2008 Share Posted October 1, 2008 Try.. $oFrame = _IEGetObjById($oIE, "frame name") $sSrc = $oFrame.src $oIE2 = _IECreate($sSrc) Link to comment Share on other sites More sharing options...
Jester009 Posted October 1, 2008 Author Share Posted October 1, 2008 Hi DjDeep00, Thanks for the reply. I tried the code, but it only launches a blank IE Link to comment Share on other sites More sharing options...
DaleHohm Posted October 1, 2008 Share Posted October 1, 2008 Make sure $oFrame is an object and that .src returns a valid URL. 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...
Jester009 Posted October 2, 2008 Author Share Posted October 2, 2008 I tried to use _IEpropertyget but that does not return a valid URL either Link to comment Share on other sites More sharing options...
pyzonet Posted November 21, 2010 Share Posted November 21, 2010 seems like autoit can not detect some elements of html !!! Link to comment Share on other sites More sharing options...
Tvern Posted November 21, 2010 Share Posted November 21, 2010 I'm pretty sure this thread was abandoned as the last post was 7 weeks ago, but if someone still cares, the urls could have been retrieved like this: #include <ie.au3> #include <array.au3> $oIE = _IECreate("http://www.quickonlinetips.com/archives/2008/08/adsense-ads-below-post-title/") $sSource = _IEDocReadHTML($oIE) $aFrames = StringRegExp($sSource,'<IFRAME.*?src="(.*?)"',3) _ArrayDisplay($aFrames) Alternatively the source could have been retrieved with InetRead, resulting in faster code. 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