Jump to content

Can Not Access IE Frames


Recommended Posts

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 by Jester009
Link to comment
Share on other sites

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

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

  • 2 years later...

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

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