1、
Private Sub Form_Load()
WebBrowser1.navigate "http://blog.csdn.net/lbuskeep"
Do
DoEvents
If Not WebBrowser1.Busy And WebBrowser1.LocationURL <> "http://blog.csdn.net/lbuskeep" Then
MsgBox "OK"
Exit Do
End If
Loop
End Sub
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object,Url As Variant)
If (pDisp Is WebBrowser1.Object) Then
MsgBox WebBrowser1.LocationURL
End If
End Sub
2、
Private Sub WebBrowser_DocumentComplete(ByVal pDisp As Object,URL As Variant) '获得网页标题 If Not WebBrowser.Busy Then '判断网页是否下载完毕 Dim strTitle As String strTitle = WebBrowser.Document.DocumentElement.InnerHtml strTitle = Mid(strTitle,1,InStr(1,LCase(strTitle),"</title>") - 1) strTitle = Mid(strTitle,"<title>") + 7) Me.Caption = strTitle End If End Sub
原文链接:https://www.f2er.com/vb/261432.html