Sign in to follow this  
Followers 0
Jester009

Can Not Access IE Frames

10 posts in this topic

#1 ·  Posted (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 by Jester009

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Hi Dale, Thanks for the advice. How do I open the frame in a new window?

Share this post


Link to post
Share on other sites

I get the Access is denied error.

How do I open the source in another window?

Any help is appreciated...

Share this post


Link to post
Share on other sites

Try..

$oFrame = _IEGetObjById($oIE, "frame name")
$sSrc = $oFrame.src
$oIE2 = _IECreate($sSrc)

Share this post


Link to post
Share on other sites

Hi DjDeep00, Thanks for the reply.

I tried the code, but it only launches a blank IE

:)

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

I tried to use _IEpropertyget but that does not return a valid URL either

:)

Share this post


Link to post
Share on other sites

seems like autoit can not detect some elements of html !!!


Example Script(s): Export Listview to Excel & Print!....(¯`v´¯)..... ·.¸.·´...¸.·´.. (☻//▌♥♥/ \ ... Wake up the dawn and ask her why ...╔══╗ ♥ ♫ ♥║██║ ♫ ♥ ♫║(O)║♥A dreamer dreams she never dies♥╚══╝۩۞۩ஜ1984'09ஜ۩۞۩

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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
Sign in to follow this  
Followers 0