因为楼主没有把问题描述清楚,写了个示例,楼主根据需要修改吧:- On Error Resume Next
- Dim objIE, Sestr, Url
- Set objIE = CreateObject("Internetexplorer.Application")
- Url = "http://www.google.com.hk/"
- Sestr = "批处理"
- objIE.Visible = True
- objIE.Navigate Url
- Do Until objIE.ReadyState = 4 : WScript.Sleep 200 : Loop
- objIE.Document.GetElementById("lst-ib").Value = Sestr
- objIE.Document.GetElementsByName("btng")(0).Click
- Do Until OK = "ok"
- Do Until objIE.ReadyState = 4 : WScript.Sleep 200 : Loop
- WScript.Sleep 200
- objIE.Document.GetElementById("pnnext").Click
- If Error Then
- Err.Clear
- OK = "ok"
- End If
- Loop
- objIE.Quit
- Set objIE = Nothing
复制代码
|