我正在尝试在 VB.net 上编写一些代码来打开网站并登录,然后运行报告。当我尝试从网站获取任何内容时,一切都运行良好,但是在 OnClick 属性中具有此指令的那些 = "return oamSubmitForm('inputParamView:paramForm','inputParamView:paramForm:_idJsp106');"
基本上,如果你看到下面的代码,你会看到我点击了一些 CheckBox,它工作得很好,但是当我检索按钮时,它没有输入输入,它实际上有网站的链接,当我调试时使用whatc。
这是我的代码(我跳过了登录部分):
Private Sub open Page()
ieb = New SHDocVw.InternetExplorerMedium()
ieb.Navigate("http://example.example/qptheme2/pages/index.faces")
ieb.visible = True
ieb.Silent = True
While Not (ieb.ReadyState = WebBrowserReadyState.Complete)
Application.DoEvents()
End While
If v.checked = False Then
v.Click()
End If
v = ie.Document.GetElementById("inputParamView:paramForm:inputParametertuesday")
If v.checked = False Then
v.Click()
End If
v = ie.Document.GetElementById("inputParamView:paramForm:_idJsp106")
v.Click() '<-- IT FAILS HERE Exception HRESULT: 0x800A01B6
如果我检查手表,它会显示 mshtml.HTMLAnchorElementClass { http://example.example/qpreport/savedpages/savedReports.faces# } 如果我检查页面中的源代码,这是我想要获取的元素:
<a id="inputParamView:paramForm:_idJsp106" onclick="return
oamSubmitForm('inputParamView:paramForm','inputParamView:paramForm:_idJsp106');" href="#"
我不知道它是否与属性 OnClick 有任何关系。
我将感谢您尝试解决此问题的任何帮助。