<td><div class="plus1-widget"><div class="plus1-msg"><div class="plus1-vote"><a href="/plus1/vote/51340?token=4d69b983e846af204adc0554645d16b2" class="plus1-link">投票</a></div></div><div class="plus1-score">319</div></div></td>
我需要获得"/plus1/vote/51340?token=4d69b983e846af204adc0554645d16b2"
其中token=后面的数据为随机的。
我是用VB编写的,把1楼的代码写进去提示出错语法错误。
Private Sub Command1_Click()
Dim re As RegExp
Dim mh As Match
Dim mhs As MatchCollection
Text1.Text = ""
Source1 = Inet1.OpenURL("
www.baidu.com
")If Source1 <> "" Then
Text1.Text = Source1
Me.Inet1.Cancel
End If
Set re = New RegExp
re.Global = True
re.Pattern = "vote\"\>\<a\shref\=\"([/\w\d=?]*)"
Set mhs = re.Execute(Source1)
For Each mh In mhs
Debug.Print mh
Next
End Sub