0
我正在制作一个VBScript的机器人,它在Internet Explorer中打开一个网页并单击一个按钮。我已打开页面,但我不知道如何点击按钮。我有这个元素。我想要做这样的事情:通过VBScript点击网页上的按钮?
browser.Document.All("Button_Name").Click()
我正在制作一个VBScript的机器人,它在Internet Explorer中打开一个网页并单击一个按钮。我已打开页面,但我不知道如何点击按钮。我有这个元素。我想要做这样的事情:通过VBScript点击网页上的按钮?
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
没有足够的信息来回答这个问题......你的建议的代码是正确的,因此,如果不工作,你需要详细说明的如果您想要帮助解决问题,请提供具体问 – Tmdean 2011-03-14 00:08:43
除了Tmdean之外,请尝试查找GetElementById()和GetElementsByName()这两个方法。他们可能是有用的。 – AutomatedChaos 2011-03-14 08:15:48