|
-
Aug 20th, 2001, 11:10 PM
#1
Thread Starter
Frenzied Member
Help!! John Yingling, Bloodeye or other webbrowser document pros..
how can i search all frames on a page to get the URL for a link named "Compose"?
the only code i know of that will help answer this question is how to search a document for a link by its name
Code:
For i = 0 To WebBrowser1.Document.links.length - 1
If WebBrowser1.Document.links(i).outertext = "Compose" Then
msgbox WebBrowser1.Document.links(i).href
End If
Next i
-
Aug 21st, 2001, 12:47 AM
#2
Frenzied Member
Try this code. I didn't test it out. I took it from this thread, and altered it a little. It looks like it should work. 
http://www.vbforums.com/showthread.p...threadid=94149
VB Code:
Dim Doc As HTMLDocument
Dim e As HTMLGenericElement
Dim a As HTMLAnchorElement
Private Sub Form_Load()
WebBrowser1.Navigate "http://www.hairdos.com/frameset.htm"
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set Doc = Nothing
End Sub
Private Sub WebBrowser1_BeforeNavigate2(ByVal pDisp As Object, _
URL As Variant, Flags As Variant, TargetFrameName As Variant, _
PostData As Variant, Headers As Variant, Cancel As Boolean)
Set Doc = Nothing
End Sub
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
Dim i As Long
Set Doc = WebBrowser1.Document
If (pDisp Is WebBrowser1.Object) Then
For i = 0 To Doc.frames.length - 1
For Each e In Doc.frames(i).Document.All
If e.tagName = "A" Then
Set a = e
If a.outertext = "Compose" then
MsgBox a.href
End If
End If
Next
Next
End If
End Sub
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
|