VB打开google搜索

解决方案 »

  1.   

    Private Declare Sub Sleep Lib "kernel32" (ByVal dwmilliseconds As Long)
    Private Sub Command1_Click()
    Dim i     As Long, j       As Long, s()       As StringWith CreateObject("InternetExplorer.Application")
    .Visible = True
    For i = 1 To 20
    .navigate "http://www.google.com/search?q=" & Text1.Text & "&num=100&hl=zh-CN&newwindow=1&start=" & start & "&sa=N"
    Do Until .Readystate = 4
    DoEvents
    Loop
    s = Split(.document.body.innerhtml, "'')""   href=""")
    For j = 1 To UBound(s)
    Debug.Print Split(s(j), """   target=")(0)
    Next
    Sleep 1000
    Next
    End With
    End Sub