我有一个函数可以给我两个单词之间的文本:
Private Shared Function GetBetween(ByRef strSource As String, ByRef strStart As String, ByRef strEnd As String, Optional ByRef startPos As Integer = 0) As String
Dim iPos As Integer, iEnd As Integer, lenStart As Integer = strStart.Length
Dim strResult As String
strResult = String.Empty
iPos = strSource.IndexOf(strStart, startPos)
iEnd = strSource.IndexOf(strEnd, iPos + lenStart)
If iPos <> -1 AndAlso iEnd <> -1 Then
strResult = strSource.Substring(iPos + lenStart, iEnd - (iPos + lenStart))
End If
Return strResult
End Function
所以我的html代码是:
<div class="upper-right-section">
<div class="header-stats">
<div class="stat-entry">
<span class="stat-value">48998</span>
<span class="stat-name">iscritti</span>
</div>
<div class="stat-entry">
<span class="stat-value">22760801</span>
<span class="stat-name">visualizzazioni video</span>
</div>
</div>
<span class="valign-shim"></span>
</div>
我有两次<span class="stat-value">
,我想获得第二次比赛的价值,我该怎么办?谢谢,马特奥。