Sign in to follow this  
Followers 0
JBJB

Need help with IE functions and nested frames/iframes

9 posts in this topic

I am trying to find a way to get field values off an IE page that appears to have many nested frames. I'd eventually like to build a spreadsheet of the data off this page.

Web Browser Spy reports: (each line is supposed to be indented further than the one above)

CODE
<MAIN DOCUMENT>

<FRAME> name=mainFrame

<IFRAME> name=contents

<IFRAME> name=frmsel

<IFRAME> name=frmpar

<IFRAME> namefrm2

DebugBar says this about one of the fields I'm trying to retrieve

<INPUT class=inputtext style="WIDTH: 100%" readOnly value=Text name=idatatype>

I have searched the forum and tried every example I can find to drill down thru the frames, but I can't seem to get to first IFRAME without error.

An example of one failed attempt: (gives nomatch error on last line)

CODE
#include <ie.au3>

#AutoIt3Wrapper_run_debug_mode=Y

$oIE = _IEAttach("My App", "Title")

$oFrame1 = _IETagnameGetCollection($oIE, "frame", 0)

$oFrame2 = _IETagnameGetCollection($oFrame1, "iframe", 0)

Since my example field above has a name, idatatype, I've tried to directly access with _IEFormElementGetValue(), but that function appears to only use a form variable, and as far as I can tell, my page has no forms. I tried a $oForm = _IEFormGetCollection($oIE, 0) to determine this . . . it came back nomatch.

So basically, I'm at a loss as to how to get data off this bugger. ANY pointers would be appreciated.

Thanks.

Share this post


Link to post
Share on other sites



I am trying to find a way to get field values off an IE page that appears to have many nested frames. I'd eventually like to build a spreadsheet of the data off this page.

Web Browser Spy reports: (each line is supposed to be indented further than the one above)

<MAIN DOCUMENT>
   <FRAME> name=mainFrame
      <IFRAME> name=contents
         <IFRAME> name=frmsel
            <IFRAME> name=frmpar
               <IFRAME> namefrm2

DebugBar says this about one of the fields I'm trying to retrieve

<INPUT class=inputtext style="WIDTH: 100%" readOnly value=Text name=idatatype>

I have searched the forum and tried every example I can find to drill down thru the frames, but I can't seem to get to first IFRAME without error.

An example of one failed attempt: (gives nomatch error on last line)

#include <ie.au3>
#AutoIt3Wrapper_run_debug_mode=Y

$oIE = _IEAttach("My App", "Title")
$oFrame1 = _IETagnameGetCollection($oIE, "frame", 0)
$oFrame2 = _IETagnameGetCollection($oFrame1, "iframe", 0)

Since my example field above has a name, idatatype, I've tried to directly access with _IEFormElementGetValue(), but that function appears to only use a form variable, and as far as I can tell, my page has no forms. I tried a $oForm = _IEFormGetCollection($oIE, 0) to determine this . . . it came back nomatch.

So basically, I'm at a loss as to how to get data off this bugger. ANY pointers would be appreciated.

Thanks.

Perhaps:

#include <ie.au3>
#AutoIt3Wrapper_run_debug_mode=Y

$oIE = _IEAttach("My App", "Title")
$oFrame1 = _IEFrameGetObjectByName($oIE, "mainFrame")
$oFrame2 = _IEFrameGetObjectByName($oFrame1, "contents")
$oFrame3 = _IEFrameGetObjectByName($oFrame2, "frmsel")
$oFrame4 = _IEFrameGetObjectByName($oFrame3, "frmpar")
$oFrame5 = _IEFrameGetObjectByName($oFrame4, "frm2")
$oInput = _IEGetObjectByName($oFrame5, "idatatype")
$sValue = _IEFormElementGetValue($oInput)
MsgBox(64, "Results", "Value = " & $sValue

:P


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

Thank you PsaltyDS, that sure looks like it should work, but . . .

!> Starting in DebugMode..

Line: @error-@extended: Line syntax

0001: 0-0: #include <ie.au3>

0006: 0-0: #AutoIt3Wrapper_run_debug_mode=Y

0007: 0-0: _IEErrorHandlerRegister()

0011: 0-0: $oIE = _IEAttach("My App", "Title")

0057: 0-0: $oFrame1 = _IEFrameGetObjByName ($oIE, "mainFrame")

0058: 0-0: $oFrame2 = _IEFrameGetObjByName ($oFrame1, "contents")

--> COM Error Encountered in test servicedesigner access_DebugIt.au3

----> $IEComErrorScriptline = 779

----> $IEComErrorNumberHex = 80020009

----> $IEComErrorNumber = -2147352567

----> $IEComErrorWinDescription = Exception occurred.

----> $IEComErrorDescription = Exception occurred.

----> $IEComErrorSource =

----> $IEComErrorHelpFile = C:\WINNT\system32\Mshtml.hlp

----> $IEComErrorHelpContext = 0

----> $IEComErrorLastDllError = 0

+>15:34:16 AutoIT3.exe ended.rc:0

Just for the heck of it, I mangled the name of the 2nd frame, "contents", and ran it again. It just came back with a no match error. So your code looks like it's finding the frame . . . . ?

Share this post


Link to post
Share on other sites

Thank you PsaltyDS, that sure looks like it should work, but . . .

!> Starting in DebugMode..

Line: @error-@extended: Line syntax

0001: 0-0: #include <ie.au3>

0006: 0-0: #AutoIt3Wrapper_run_debug_mode=Y

0007: 0-0: _IEErrorHandlerRegister()

0011: 0-0: $oIE = _IEAttach("My App", "Title")

0057: 0-0: $oFrame1 = _IEFrameGetObjByName ($oIE, "mainFrame")

0058: 0-0: $oFrame2 = _IEFrameGetObjByName ($oFrame1, "contents")

--> COM Error Encountered in test servicedesigner access_DebugIt.au3

----> $IEComErrorScriptline = 779

----> $IEComErrorNumberHex = 80020009

----> $IEComErrorNumber = -2147352567

----> $IEComErrorWinDescription = Exception occurred.

----> $IEComErrorDescription = Exception occurred.

----> $IEComErrorSource =

----> $IEComErrorHelpFile = C:\WINNT\system32\Mshtml.hlp

----> $IEComErrorHelpContext = 0

----> $IEComErrorLastDllError = 0

+>15:34:16 AutoIT3.exe ended.rc:0

Just for the heck of it, I mangled the name of the 2nd frame, "contents", and ran it again. It just came back with a no match error. So your code looks like it's finding the frame . . . . ?

What's in these iFrames? Is it another web site from a different location? I ask because it sounds like blocked cross-site access, but then that error description doesn't sound like it. :P

Hopefully, Dale will jump in here and enlighten us.

:P


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

That isn't the typical security-related error (Access is denied).

So, the last question is still a good one... what's in those frames? If it html or perhaps a PDF or something else? Inportant things are how the frame source locations relate to the containing document location and what they contain.

Are you able to provide 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

Share this post


Link to post
Share on other sites

I'm not able to provide a reproducer as this application is running on a private corp network. The application is a web-based development tool, and the page I'm on defines field attributes. The top has a scrolling list of fields, and the bottom has a tabbed object showing all the attributes for the chosen field. There is a lot of javascript on the page.

I don't know if it's helpful, but the DOM tab in DebugBar only shows one iframe that I can see . . . not sure why Spy showed more.

Not being a web guy, I'm not sure what to provide you, to help you help me.

Share this post


Link to post
Share on other sites

We'll minimally need to know the url of the top level document and the src=url of each of the frames (you can obfuscate the domain name, but make sure it still conveys the structure).

Notice in the DebugBar toolbar there is a dropdown to the left of the eye icon that shows you frame structure.

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

Here's the structure

<MAIN DOCUMENT> HTTP://devsvr1.bbdc.tr.org:9080/RCenter/
  <FRAME> name=mainFrame src=http://devsvr1.bbdc.tr.org:9080/RCenter/catalog/area-main.cfm?resetBN=true
    <IFRAME> name=contents src=http://devsvr1.bbdc.tr.org:9080/RCenter/catalog/service-htmlrep.cfm?ServiceID=28
      <IFRAME> name=frmsel src=http://devsvr1.bbdc.tr.org:9080/RCenter/catalog/service-htmlrep-typesel.cfm?Action=update
        <IFRAME> name=frmpar src=http://devsvr1.bbdc.tr.org:9080/RCenter/catalog/service-htmlrep-par.cfm?Action=UpdateSel
          <IFRAME> name=frm2 src=about:blank

Thanks for looking at this.

Share this post


Link to post
Share on other sites

I was afraid of that... it tells us nothing about the content in the frames (although it looks like it is Cold Fusion). They are all on the same server however, which overcomes one roadblock.

Can you right-click on the contents frame and View Source? If you choose the contents frame in the DebugBar dropdown I mentioned above, will it should you its source?

I'm curious... I see DebugIt in the output you show here... how are you running this application? Are you doing through the DebugIt helper or directly from SciTe? Does it behave differently if run just in SciTe?

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

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