用vb怎么获取网页标题
1个回答
展开全部
Function GetPageTitle(ByVal strCode As String) As String
'这里假设 strCode 是网页源代码
Dim strTemp As String, i As Integer, j As Integer
i = InStr(1, LCase(strCode), "<title>") + 7
j = InStr(i, LCase(strCode), "</title>")
strTemp = Mid(strCode, i, j - l)
GetTitle = strTemp
End Function
'这里假设 strCode 是网页源代码
Dim strTemp As String, i As Integer, j As Integer
i = InStr(1, LCase(strCode), "<title>") + 7
j = InStr(i, LCase(strCode), "</title>")
strTemp = Mid(strCode, i, j - l)
GetTitle = strTemp
End Function
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询