Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
 
 
 
500MB 27GB Web Hosting - $9.95/Month
 
 
 
 
 
Old Pages
 
Old Index
Site Map
What's New
 
Books
How To
Tips & Tricks
Tutorials
Stories
Performance
Essays
Links
Q & A
New in VB6
Free Stuff
Pictures
 
 
 
TitleList the links available at a URL
Keywordslinks, URL, Web
CategoriesUtilities, Controls, Internet
 
Open the URL with the WebBrowser control. Use its Document object's links collection to list the links.

Using a similar technique you can look at the Document object's other properties.

 
Private Sub cmdListLinks_Click()
Dim i As Integer

    cmdListLinks.Enabled = False
    Screen.MousePointer = vbHourglass
    DoEvents

    ' Open the URL.
    wbrSource.Navigate txtURL.Text

    ' Wait until the document is loaded.
    Do While wbrSource.ReadyState <> READYSTATE_COMPLETE
        DoEvents
    Loop

    ' List the links available.
    lstLinks.Clear
    For i = 0 To wbrSource.Document.links.length - 1
        lstLinks.AddItem wbrSource.Document.links(i).href
    Next i

    ' Reenable the button.
    cmdListLinks.Enabled = True
    Screen.MousePointer = vbDefault
End Sub
 
 
Copyright © 1997-2003 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated