Private Sub Command1_Click() WebBrowser1.navigate "http://jiangfanwk.blog.sohu.com/entry/" End SubPrivate Sub webbrowser1_documentcomplete(ByVal pDisp As Object, URL As Variant) Text1.Text = WebBrowser1.document.body.innerText End Sub
....汗...谢谢,我要的不是用WebBrowser1来获取.....求助~~
Option Explicit '引用 Internet comntrols '程序运行时可能要15秒左右才能下载完毕. Dim WithEvents ieQC As InternetExplorer Dim ieBusy As BooleanPrivate Sub Command1_Click() Dim strHtml As String, arr() As String, arr1() As String Dim i As Long, Result As String ieBusy = False Set ieQC = New InternetExplorer ieQC.Navigate2 "http://jiangfanwk.blog.sohu.com/entry/" Do DoEvents
Loop While Not ieBusy strHtml = ieQC.document.body.innerText Set ieQC = Nothing arr = Split(strHtml, vbCrLf) For i = 0 To UBound(arr) If Mid(arr(i), 5, 1) = "-" And Mid(arr(i), 12, 1) = "|" Then arr1 = Split(arr(i), "|") Result = Result & arr1(1) & vbCrLf End If Next i Text1.Text = ResultEnd SubPrivate Sub ieQC_DocumentComplete(ByVal pDisp As Object, URL As Variant) Debug.Print ieQC.Busy '这个测试到页面多框架下,有多次下载,所以单纯用busy判断不行
If (pDisp Is ieQC) Then ieBusy = True
End If End Sub
Private Sub Command4_Click() Dim s() As String, i As Long With CreateObject("Msxml2.XMLHTTP") .Open "GET", "http://jiangfanwk.blog.sohu.com/action/v_frag-ebi_b2bda04792/entry/", False .Send s = Split(.responseText, "entryTitle=""") End With For i = 1 To UBound(s) Debug.Print Split(s(i), """")(0) Next End Sub
WebBrowser1.navigate "http://jiangfanwk.blog.sohu.com/entry/"
End SubPrivate Sub webbrowser1_documentcomplete(ByVal pDisp As Object, URL As Variant)
Text1.Text = WebBrowser1.document.body.innerText
End Sub
'引用 Internet comntrols '程序运行时可能要15秒左右才能下载完毕.
Dim WithEvents ieQC As InternetExplorer
Dim ieBusy As BooleanPrivate Sub Command1_Click()
Dim strHtml As String, arr() As String, arr1() As String
Dim i As Long, Result As String
ieBusy = False
Set ieQC = New InternetExplorer
ieQC.Navigate2 "http://jiangfanwk.blog.sohu.com/entry/"
Do
DoEvents
Loop While Not ieBusy
strHtml = ieQC.document.body.innerText
Set ieQC = Nothing
arr = Split(strHtml, vbCrLf)
For i = 0 To UBound(arr)
If Mid(arr(i), 5, 1) = "-" And Mid(arr(i), 12, 1) = "|" Then
arr1 = Split(arr(i), "|")
Result = Result & arr1(1) & vbCrLf
End If
Next i Text1.Text = ResultEnd SubPrivate Sub ieQC_DocumentComplete(ByVal pDisp As Object, URL As Variant)
Debug.Print ieQC.Busy '这个测试到页面多框架下,有多次下载,所以单纯用busy判断不行
If (pDisp Is ieQC) Then
ieBusy = True
End If
End Sub
Dim s() As String, i As Long
With CreateObject("Msxml2.XMLHTTP")
.Open "GET", "http://jiangfanwk.blog.sohu.com/action/v_frag-ebi_b2bda04792/entry/", False
.Send
s = Split(.responseText, "entryTitle=""")
End With
For i = 1 To UBound(s)
Debug.Print Split(s(i), """")(0)
Next
End Sub
这个地址是怎么找到的啊??