|
On error resume next
Set reg=createobject("Mercury.CompareRegExp")
j=0
Browser("Google").Page("Google").WebEdit("q").Set "李明"
Browser("Google").Page("Google").WebButton("Google 搜索").Click
Set linkdesc=description.Create()
linkdesc("html tag").value="A"
Set linkobject=Browser("Google").Page("李明 - Google 搜索").ChildObjects(linkdesc)
a=linkobject.count
For i=0 to a-1
text=linkobject(i).GetRoproperty("text")
reg.Initialize "李明.*"
If reg.Compare(text) Then
j=j+1
End If
Next
'msgbox j
'k=randomNumber(0,j-1)
For k=1 to j
linkobject(k).click
Set linkobject=Browser("Google").Page("李明 - Google 搜索").ChildObjects(linkdesc)
Next |
|