Html 如何单击没有名称的按钮
我正在尝试使用以下代码单击带有VBScript的按钮:Html 如何单击没有名称的按钮,html,vbscript,form-submit,Html,Vbscript,Form Submit,我正在尝试使用以下代码单击带有VBScript的按钮: Set IE = CreateObject("InternetExplorer.Application") Set WshShell = WScript.CreateObject("WScript.Shell") IE.Navigate "google.com" IE.Visible = True Wscript.Sleep 2000 IE.Document.All.Item("uss").Value = "username"
Set IE = CreateObject("InternetExplorer.Application")
Set WshShell = WScript.CreateObject("WScript.Shell")
IE.Navigate "google.com"
IE.Visible = True
Wscript.Sleep 2000
IE.Document.All.Item("uss").Value = "username"
IE.Document.All.Item("pass").Value = "pass"
IE.Document.All.Item("character").Value = "character"
IE.Document.All("").Click()
我怎么能点击一个没有名字的按钮
这是我试图选择的submit
按钮:
<td colspan="2" align="right"><input type="submit" value="Submit Now!"></td>
请注意,按钮没有名称。如果我尝试使用提交功能,scipt将不起作用或网页没有响应。有什么想法吗?在这种情况下,您没有选择的余地,所以请按标签名抓取
For Each btn In IE.Document.getElementsByTagName("input")
If btn.type = "submit" Then btn.Click()
Next