Quinn Posted December 10, 2010 Share Posted December 10, 2010 Hi there! I am trying to access to forms inside the iFrame, but with no success so far. This is Javascript generated document. There are two iFrames with only id's, no names. _IEFrameGetCollection with _IEPropertyGet returns zeroes and following error: IE.au3 V2.4-0 Error from function _IEPropertyGet, $_IEStatus_InvalidObjectType Is it possible to access these forms with IE.au3? Thanks, Quinn Link to comment Share on other sites More sharing options...
Juvigy Posted December 10, 2010 Share Posted December 10, 2010 $oIE = _IE_Example ("siteaddress") $oFrames = _IEFrameGetCollection ($oIE) $iNumFrames = @extended For $i = 0 to ($iNumFrames - 1) $oFrame = _IEFrameGetCollection ($oIE, $i) MsgBox(0, "Frame Number:", $i) Next You say that this doesnt work for you? Post some of the source code of the page. Link to comment Share on other sites More sharing options...
PsaltyDS Posted December 10, 2010 Share Posted December 10, 2010 Also add _IEErrorHandlerRegister() to the top of your script and run it in SciTE to see all the output in the console. You may see a lot of "Access Denied" if hitting an XSS (cross-site scripting) violation. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
wakillon Posted December 10, 2010 Share Posted December 10, 2010 First, Welcolme to the Forum ! And could you give the url for tests by my side ? AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
Quinn Posted December 10, 2010 Author Share Posted December 10, 2010 $oIE = _IE_Example ("siteaddress") $oFrames = _IEFrameGetCollection ($oIE) $iNumFrames = @extended For $i = 0 to ($iNumFrames - 1) $oFrame = _IEFrameGetCollection ($oIE, $i) MsgBox(0, "Frame Number:", $i) Next You say that this doesnt work for you? This works, but ther are errors if I try to use forms inside the frame. Something like this: Include\IE.au3 (713) : ==> The requested action with this object has failed.: If String($o_object.document.body.tagName) = "FRAMESET" Then If String($o_object.document^ ERROR ->19:33:18 AutoIT3.exe ended.rc:1 Quinn Link to comment Share on other sites More sharing options...
Quinn Posted December 10, 2010 Author Share Posted December 10, 2010 First, Welcolme to the Forum ! And could you give the url for tests by my side ?Sorry, I must ask for permission before posting any code here, since this is copyrighted business software. It works in intranet only, so there is no public url.Thanks,Quinn Link to comment Share on other sites More sharing options...
DaleHohm Posted December 11, 2010 Share Posted December 11, 2010 You ignored PSaltyDS's suggestion... it is important! 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...
Quinn Posted December 13, 2010 Author Share Posted December 13, 2010 You ignored PSaltyDS's suggestion... it is important! Dale Ok, here is the code: #include <IE.au3> _IEErrorHandlerRegister() Local $oIE = _IEAttach("Baza") $oFrames = _IEFrameGetCollection ($oIE) $oForms = _IEFormGetCollection ($oFrames, 1) and the output: --> COM Error Encountered in IETest2.au3 ----> $IEComErrorScriptline = 2214 ----> $IEComErrorNumberHex = 80020009 ----> $IEComErrorNumber = -2147352567 ----> $IEComErrorWinDescription = Access denied. ----> $IEComErrorDescription = Access denied. ----> $IEComErrorSource = ----> $IEComErrorHelpFile = C:\WINNT\system32\mshtml.hlp ----> $IEComErrorHelpContext = 0 ----> $IEComErrorLastDllError = 0 --> COM Error Encountered in IETest2.au3 ----> $IEComErrorScriptline = 1076 ----> $IEComErrorNumberHex = 000000A9 ----> $IEComErrorNumber = 169 ----> $IEComErrorWinDescription = Variable must be of type 'Object'. ----> $IEComErrorDescription = Access denied. ----> $IEComErrorSource = ----> $IEComErrorHelpFile = C:\WINNT\system32\mshtml.hlp ----> $IEComErrorHelpContext = 0 ----> $IEComErrorLastDllError = 0 --> COM Error Encountered in IETest2.au3 ----> $IEComErrorScriptline = 1076 ----> $IEComErrorNumberHex = 000000A9 ----> $IEComErrorNumber = 169 ----> $IEComErrorWinDescription = Variable must be of type 'Object'. ----> $IEComErrorDescription = Access denied. ----> $IEComErrorSource = ----> $IEComErrorHelpFile = C:\WINNT\system32\mshtml.hlp ----> $IEComErrorHelpContext = 0 ----> $IEComErrorLastDllError = 0 --> IE.au3 V2.4-0 Warning from function _IEFormGetCollection, $_IEStatus_NoMatch +>08:01:32 AutoIT3.exe ended.rc:0 >Exit code: 0 Time: 1.778 Quinn Link to comment Share on other sites More sharing options...
PsaltyDS Posted December 13, 2010 Share Posted December 13, 2010 (edited) Ok, here is the code: #include <IE.au3> _IEErrorHandlerRegister() Local $oIE = _IEAttach("Baza") $oFrames = _IEFrameGetCollection ($oIE) $oForms = _IEFormGetCollection ($oFrames, 1) and the output: Quinn As Poe might have said: You may see a lot of "Access Denied" if hitting an XSS (cross-site scripting) violation. You might be out of luck, but there are some things left to try. You can get the target URL of the frame and open it directly in its own instance of IE then work with it there. Edited December 13, 2010 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Quinn Posted December 14, 2010 Author Share Posted December 14, 2010 As Poe might have said: You might be out of luck, but there are some things left to try. You can get the target URL of the frame and open it directly in its own instance of IE then work with it there.Thanks for your help.Quinn Link to comment Share on other sites More sharing options...
ppinto Posted October 9, 2012 Share Posted October 9, 2012 (edited) Hello,I am new to the forum, and I beg your pardon if an introduction is lacking.I was working for the first time with IE.au3, and I was trying to fetch information from a sports betting website, regarding the odds of a particular game.The site in question is http://www.betdaq.com/UI/?siteTab=exchange¤tPreferences=1, and according to the Element Inspector from Google Chrome, it has an iframe which contains a #document in it (I suppose it is a javascript document).Nevertheless, I tried a code similar to the one at the beginning of this topic:_IEErrorHandlerRegister()$betdaq = "http://www.betdaq.com/UI/?siteTab=exchange¤tPreferences=1"$oIE = _IECreate ($betdaq)$oFrames = _IEFrameGetCollection ($oIE)$iNumFrames = @extendedFor $i = 0 to ($iNumFrames - 1) $oFrame = _IEFrameGetCollection ($oIE, $i) MsgBox(0, "Frame Number:", $i)NextBut this gave me the following error when executing the _IEFrameGetCollection (which I could read in the Scite window):>"C:Program FilesAutoIt3SciTE..autoit3.exe" /ErrorStdOut "C:Documents and SettingsAdministratorDesktopmanual update without registry.au3" --> COM Error Encountered in manual update without registry.au3----> $IEComErrorScriptline = 745----> $IEComErrorNumberHex = 80020006----> $IEComErrorNumber = -2147352570----> $IEComErrorWinDescription = Unknown name.----> $IEComErrorDescription =----> $IEComErrorSource =----> $IEComErrorHelpFile =----> $IEComErrorHelpContext =----> $IEComErrorLastDllError = 0>Exit code: 0 Time: 6.504From my search, the only relevant topic with a similar issue was this. If this was tackled somewhere else, a reference to the solution would be appreciated. I am sorry if I breached the terms & conditions by asking something regarding a commercial site, but this info is pretty straighforward to get at several other bookies.Thank you for your time,Kind regards,Pedro Edited October 9, 2012 by ppinto Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 9, 2012 Moderators Share Posted October 9, 2012 ppinto,Welcome to the AutoIt forum. trying to fetch information from a sports betting website, regarding the odds of a particular gameI am sorry if I breached the terms & conditions by asking something regarding a commercial siteI am afraid that we are not prepared to support something like this. I hope you understand and that we can help you with something else in the future. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts