Sign in to follow this  
Followers 0
Quinn

IE iFrame problem

12 posts in this topic

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

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

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.

:x


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

Share this post


Link to post
Share on other sites

First, Welcolme to the Forum ! Posted Image

And could you give the url for tests by my side ?


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

$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

Share this post


Link to post
Share on other sites

First, Welcolme to the Forum ! Posted Image

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

#9 ·  Posted (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.

:x

Edited 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

Share this post


Link to post
Share on other sites

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.

:x

Thanks for your help.

Quinn

Share this post


Link to post
Share on other sites

#11 ·  Posted (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&currentPreferences=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&currentPreferences=1"

$oIE = _IECreate ($betdaq)

$oFrames = _IEFrameGetCollection ($oIE)

$iNumFrames = @extended

For $i = 0 to ($iNumFrames - 1)

$oFrame = _IEFrameGetCollection ($oIE, $i)

MsgBox(0, "Frame Number:", $i)

Next

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

From 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 by ppinto

Share this post


Link to post
Share on other sites

ppinto,

Welcome to the AutoIt forum. :)

trying to fetch information from a sports betting website, regarding the odds of a particular game

I am sorry if I breached the terms & conditions by asking something regarding a commercial site

I 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._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0