用vb怎么获取网页标题

来源:互联网 发布:淘宝店手机端怎么弄 编辑:程序博客网 时间:2024/05/18 02:45

http://tieba.baidu.com/f?kz=255370663

搜集到一个程序

 

几乎都用它来完成采集任务了!贡献出来啊,很简单滴
Function strCut(strContent, StrStart, StrEnd) As String '通用截取函数
 Dim strHtml, S1, S2 As String
 dim strstart,strend as string
 strHtml = strContent
 On Error Resume Next
 
 S1 = InStr(strHtml, StrStart) + Len(StrStart)
 S2 = InStr(S1, strHtml, StrEnd)
 strCut = Mid(strHtml, S1, S2 - S1)
 
End Function

Private Sub Form_Load()
Dim hunzi1, hunzi2 As String
hunzi1 = "<html><title>this is title</title></html>"
hunzi2 = strCut(hunzi1, "<title>", "</title>")
MsgBox hunzi2
End Sub