VB WebBrowser 获取网页内容
用WebBrowser浏览一个网页这个网页的源代码含有<html><head><metahttp-equiv=content-typecontent="text/html...
用WebBrowser浏览一个网页
这个网页的源代码含有
<html><head><meta http-equiv=content-type content="text/html; charset=gb2312"><title>false_034598776的空间_百度空间 </title>
如何使用WebBrowser的Document获取<title></title>之间的内容?
最好给出如何源代码 展开
这个网页的源代码含有
<html><head><meta http-equiv=content-type content="text/html; charset=gb2312"><title>false_034598776的空间_百度空间 </title>
如何使用WebBrowser的Document获取<title></title>之间的内容?
最好给出如何源代码 展开
3个回答
展开全部
'加碰亩仿入一个webbrowser控件,一个按钮,同时在菜单的:工程-引用笑纤里找到耐信 Microsoft HTML Object Libraray这个库并引用它,即可
Private Sub Command1_Click()
WebBrowser1.Navigate "http://hi.baidu.com/034598776/"
End Sub
Private Sub Form_Load()
WebBrowser1.Stop
End Sub
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
Dim kkk As MSHTML.HTMLDocument
Dim title As MSHTML.HTMLTitleElement
Set kkk = WebBrowser1.Document
Debug.Print kkk.title
End Sub
Private Sub Command1_Click()
WebBrowser1.Navigate "http://hi.baidu.com/034598776/"
End Sub
Private Sub Form_Load()
WebBrowser1.Stop
End Sub
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
Dim kkk As MSHTML.HTMLDocument
Dim title As MSHTML.HTMLTitleElement
Set kkk = WebBrowser1.Document
Debug.Print kkk.title
End Sub
展开全部
希望这个程伍野册序对你有启发腔宏。
Private Sub Command1_Click()
a = "11111111111111111111<title>false_034598776的脊胡空间_百度空间 </title>"
a1 = InStr(1, a, "<title>") + 7
a2 = InStr(1, a, "</title>")
a3 = a2 - a1
c = Mid(a, a1, a3)
MsgBox c
End Sub
Private Sub Command1_Click()
a = "11111111111111111111<title>false_034598776的脊胡空间_百度空间 </title>"
a1 = InStr(1, a, "<title>") + 7
a2 = InStr(1, a, "</title>")
a3 = a2 - a1
c = Mid(a, a1, a3)
MsgBox c
End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
想获取网页标题啊州运。册辩梁。
Private Sub Command1_Click()
MsgBox WebBrowser1.LocationName
End Sub
Private Sub Form_Load()
WebBrowser1.Navigate "www.baidu.com"灶庆
End Sub
Private Sub Command1_Click()
MsgBox WebBrowser1.LocationName
End Sub
Private Sub Form_Load()
WebBrowser1.Navigate "www.baidu.com"灶庆
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询