通过VBScript点击网页上的按钮? [英] Click Button on Webpage via VBScript?

查看:28
本文介绍了通过VBScript点击网页上的按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 VBScript 制作一个机器人,它可以在 Internet Explorer 中打开一个网页并单击一个按钮.我已经打开页面了,但我不知道如何点击按钮.我有这个元素.我想做这样的事情:

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_Name").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

这篇关于通过VBScript点击网页上的按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆