Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Missing elements

0 views
Skip to first unread message

cla...@claudesplace.com

unread,
Nov 15, 2006, 5:55:29 PM11/15/06
to
I am trying to script getting reports from a website which includes a
java applet. One of the pages has a table with a series of inputs of
type "submit" with names which begin with an @ sign. None of these show
up in the form's elements array. The page has frames but I have found
the right form. Here is some of the code:

Set mainFrm = Nothing
Do While mainFrm Is Nothing
For i = 0 To .Document.parentWindow.Frames.Length - 1
If
.Document.parentWindow.Frames(i).Document.Forms.Length > 0 Then
If
.Document.parentWindow.Frames(i).Document.Forms(0).name = "main" Then
Set mainFrm =
.Document.parentWindow.Frames(i).Document.Forms(0)
Debug.Print "Main Form"
For j = 0 To mainFrm.Elements.Length - 1
Debug.Print mainFrm.Elements(j).name
Next
End If
End If
Next
Pause 2 ' doEvents for 2 seconds
Loop

The page is slow in loading, even after busy is false and ReadyState =
4 and the first time around the main form does not exist so I use a
loop. None of the submit inputs shows up in the elements array. I
thought I could get around this by setting the PostData myself using
Navigate2 but then IE puts up an error dialog box about a page being
redisplayed. What am I doing wrong?

Claude

unread,
Nov 22, 2006, 12:55:47 AM11/22/06
to
I solved the problem. The problem was the form I was looking for was
actually in a frame of a frame. I needed to use recursion to find the
form with the button I was looking for. Then, all I needed to do was
call the button's click function.

0 new messages