|
-
Apr 19th, 2005, 07:29 AM
#1
-
Apr 19th, 2005, 04:17 PM
#2
Re: WebBrowser Click Button (JavaScript)
Thanks for the reply Vader 
Ok, I have attached the JS file (as menu.txt(zip)), and the results of the innerHTML after the page had loaded as innerHTML.txt.
Note: I have many times tried to navigate to the wireless.htm directly thru code, but that generates browser errors. I guess there are a few unset variables that are requried - hence the browser errors. Because of this I have tried to submit a .Click to the 'wirless' button.
VB Code:
WebBrowser1.Document.location.href = "../cgi-bin/webcm?getpage=../html/home/home_wizard.htm"
innerHTML Results:
<FRAME name=fPanel marginWidth=0 marginHeight=0 src=""><FRAME name=fInfo src="../cgi-bin/webcm?getpage=../html/home/home_RelaodHref.htm&var:RelaodHref="><NOFRAMES>
<body bgcolor="#008080">
<p>This page uses frames, but your browser doesn't support them.</p>
</body>
</NOFRAMES>
(PS I have clipped the tail end of the attached Java Code (menu.txt))
Regards,
Bruce
Last edited by Bruce Fox; Apr 19th, 2005 at 07:05 PM.
-
Apr 19th, 2005, 04:30 PM
#3
Fanatic Member
Re: WebBrowser Click Button (JavaScript)
I don't understand much of the structure of that site... but it looks like the index page is a frameset that contains other pages. You can get to those pages with the document.frames collection.
It would be much easier if I could just navigate to the page on the web; can you post the URL? I get script errors when I try to open mytext.htm with menu.js.
Author for Visual Basic Web Magazine
-
Apr 19th, 2005, 04:33 PM
#4
Re: WebBrowser Click Button (JavaScript)
Unfortunatly I cannot provide the URL, as its internal to my ADSL Modem.
I will try to iterate Frame collection 
Bruce.
-
Apr 19th, 2005, 04:39 PM
#5
Fanatic Member
Re: WebBrowser Click Button (JavaScript)
Okay; this piece of code may help you. It adds all (inline) frames (including nested ones) to a collection colDocuments. You can use items from colDocuments just like any other document object (e.g. you can use colDocuments(0).body.innerHTML). 
VB Code:
Private Sub GetFrames()
'Purpose: searches all frames in the document(s) and adds them to colDocuments
Dim i As Integer, j As Integer
j = 1
Set colDocuments = New Collection
colDocuments.Add WebBrowser1.Document
Do While j < colDocuments.Count + 1
For i = 0 To colDocuments.Item(j).frames.length - 1
colDocuments.Add colDocuments.Item(j).frames.Item(i).Document
Next i
j = j + 1
Loop
End Sub
Author for Visual Basic Web Magazine
-
Apr 19th, 2005, 05:04 PM
#6
Re: WebBrowser Click Button (JavaScript)
Ok, thats what I needed. I now have the TD/TR matrix.
I will try to iterate thru that and on match, perform a .Click (to envoke the "doLink('/html/home/wireless.htm')!
Bruce.
-
Apr 19th, 2005, 06:02 PM
#7
Re: WebBrowser Click Button (JavaScript)
I have beena ble to load the Collection, iterate thru and determine the index/location of the TD containing the 'Wireless' tag.
Now I have that, I cannot work out the syntax to be used on the WebBrowser.Document to perform a .Click on that item?
VB Code:
WebBrowser1.Document.All.Item(3).body.innerHTML.getElementsByName("TD").Item(8).Click

Bruce.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|