本文介绍了通过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在网页上单击按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!