Private Sub Command1_Click()
Dim strurl As String
Dim strweb As String
strurl = "http://guba.eastmoney.com/list,600000.html"
WebBrowser1.Navigate2 (strurl)
strweb = WebBrowser1_DocumentComplete
MsgBox strweb
End Sub
uj5u.com熱心網友回復:
你應該在WebBrowser1_DocumentComplete事件中處理下載后的內容.....Navigate2 后立即獲取內容那時不可能的。uj5u.com熱心網友回復:
Dim strweb As StringPrivate Sub Command1_Click()
WebBrowser1.Navigate2 "http://guba.eastmoney.com/list,600000.html"
End Sub
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
strweb = WebBrowser1.Document.All.outerhtml
If (pDisp Is WebBrowser1.Object) Then MsgBox "網頁下載完畢!"
End Sub
出現錯誤提示
實時錯誤 ‘91’:
物件變數或With塊變數未設定
這句是黃色的strweb = WebBrowser1.Document.All.outerhtml
什么原因
uj5u.com熱心網友回復:
這樣使用:WebBrowser1.Document.documentElement.outerHTML
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/99654.html
標籤:網絡編程
上一篇:新人能夠熟練試用C#,但是我進的公司讓我寫VB。。。
下一篇:vb編程實作灰度影像轉偽彩色圖
