开发者

Click Button on Webpage via VBScript?

开发者 https://www.devze.com 2023-02-17 01:34 出处:网络
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 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

精彩评论

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