开发者

Click Button on Webpage via VBScript?

I am working on making a bot with VBScript, that opens a webpage in Internet Explorer and clicks a button. I have opening the page down, but I don't know how to click the button. I have the element. I want to do something like this:

browser.Document.All("Button_Nam开发者_运维知识库e").Click()


'Search Google
Dim objWshShell,IE,searchStr

Set objWshShell = Wscript.CreateObject("Wscript.Shell")
Set IE = CreateObject("InternetExplorer.Application")
searchStr = InputBox("Search")

With IE
  .Visible = True
  .Navigate "http://www.google.com"

'Wait for Browser
  Do While .Busy
    WScript.Sleep 100
  Loop
  .Document.getElementsByName("q").Item(0).Value = searchStr
  .Document.getElementsByName("btnK").Item(0).Click
End With
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜