|
还不成熟
SystemUtil.Run "C:\Program Files\Internet Explorer\IEXPLORE.EXE","http://www.google.com/webhp?complete=1&hl=en"
Browser("Google").Page("Google").WebEdit("q").Object.focus
wait 3
Dim tb,rcount
search = "Quick" 'any string you want to search...
arrsearch = SplitString(search)
For i = 0 to UBound(arrsearch) - 1
Browser("Google").Page("Google").WebEdit("q").Set arrsearch(i)
Browser("Google").Page("Google").WebEdit("q").FireEvent "onkeyup"
Wait(1)
Next
Dim value1,value2
rcount=Browser("Google").Page("Google").WebTable("index:=1").RowCount
For i=0 to rcount-1
value1=Browser("Google").Page("Google").WebTable("index:=1").GetCellData(i,1)
value2=Browser("Google").Page("Google").WebTable("index:=1").GetCellData(i,2)
DataTable.Value(1,1)=value1
DataTable.Value(2,1)=value2
' ------------------------------------------
' please init DataTable first....
'-------------------------------------------
DataTable.SetCurrentRow(i+1)
Next
Function SplitString(str)
Dim arr()
'search = "Hello world"
length = len(str)
Redim arr(length)
For intCounter = 0 to UBound(arr) - 1
arr(intCounter) = Mid(search, 1,intCounter + 1)
Next
SplitString = arr
End Function |
|