vb如何通过WebBrowser取得网页中至之间的内容
我通过以下代码可以取得当前目当下tx2.htm网页的源码,可是却没有<HEAD>至</HEAD>之间的内容,请问如何才能取得他的内容呢
Option Explicit
Dim s As String, b As String
Private Sub Form_Load()
WebBrowser1.Navigate App.Path & "\tx2.htm"
End Sub
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
Text2 = WebBrowser1.LocationURL ' 显示当前网址
' 判断当前网页是否全部调入完毕
If Not (pDisp Is WebBrowser1.Object) Then Exit Sub
Dim doc, objhtml
Set doc = WebBrowser1.Document
Set objhtml = doc.body.createTextRange()
If Not IsNull(objhtml) Then
s = objhtml.htmlText
Text1 = s
End If
End Sub
[此贴子已经被作者于2006-6-7 11:17:56编辑过]