Click Button on Webpage via VBScript?

前端 未结 1 693
醉话见心
醉话见心 2021-01-15 20:36

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 b

相关标签:
1条回答
  • 2021-01-15 21:11
    '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 讨论(0)
提交回复
热议问题