conchocon Posted August 26, 2007 Share Posted August 26, 2007 (edited) I got a problem about ActiveX. When I code some code like : #include <IE.au3> $oFrame = _IEFrameGetCollection($oIE,0) _IELinkClickByIndex($oFrame,1) In some case( always happens with some HTML script ), there'll be an error : "C:\PROGRA~1\AutoIt3\Include\IE.au3 (976) : ==> The requested action with this object has failed.: Local $oLinks = $o_object.document.links, $oLink Local $oLinks = $o_object.document^ ERROR " I've read some document on MSDN but I can't find anything to solve it. Anyone can help me ? Thanks for your reading ! My English's so bad but I hope you'll understand ^^ Edited August 26, 2007 by conchocon Link to comment Share on other sites More sharing options...
DaleHohm Posted August 26, 2007 Share Posted August 26, 2007 One possibilty is that the document in the frame has not full loaded when you attempt this. Typy placing this prior to your LinkClick: _IELoadWait($oFrame) It is also possible that it is not a valid HTML document (like a pdf file for example). If this isn't enough to help you'll need to create a reproducer. 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...
conchocon Posted August 27, 2007 Author Share Posted August 27, 2007 Thanks ! Few hours after I posted the topic, I tried to code at least using UDF as possible to reduce bugs but there's still error, althought the website has full loaded. First I navigate the website. and wait for full loading Then I use this code : #include <IE.au3> $oIE = _IEAttach("Example") If IsObj($oIE) Then $oFrame = $oIE.document.parentwindow.frames.item (0) If IsObj($oFrame) Then MsgBox(0,"Result",$oFrame.document.body.innerHTML) EndIf Else MsgBox(0,"Warning !","This is invalid object") End EndIf There's still error : "The requested action with this object has failed" I don't know what wrong ! I've check $oFrame's a valid oject or avaiable yet and it's I-want-it-to-be. But I can't access it ! At first, I thought about something relates to privillege so I create an IE's object ( not attach ) but there's still error. After that, I tried on VB but there's the same problem. Of course, this error comes with some HTML file. The typical example you can find anywhere is google ads frame.You can't access the google inline frame with that code. I checked in my HTML code but there's not any javascript code protect the inline frame. If I remove all javascript, that code perfectly works ! . So I don't understand what's happen ! Link to comment Share on other sites More sharing options...
DaleHohm Posted August 27, 2007 Share Posted August 27, 2007 (edited) Ah ok. Likely a cross frame security restriction - you cannot work across frames when they are in different domains. You'll need to open the frame in a new window. Dale Edited August 27, 2007 by DaleHohm 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