我用Webbrowser 控件编号,网页里有[确定]按钮,加载完网页后,想点击确定,可提示我“对象不支持该属性或方法”,什么意思?下面是我的代码。应该没有错误吧。Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
Dim u As Object, bt As Object
Set u = pDisp.Document.getElementById("title")
Set bt = pDisp.Document.getElementById("queryButton") If Not u Is Nothing And Not bt Is Nothing Then
u.Value = "0021"
bt.Click
End If
End Sub
另外我也试了,任何代码都不写,我只加载网页就像这样
webbrowser1.Navigate "http://******"。然后再点击里面的确定按钮也会出现同样的错误!
Dim u As Object, bt As Object
Set u = pDisp.Document.getElementById("title")
Set bt = pDisp.Document.getElementById("queryButton") If Not u Is Nothing And Not bt Is Nothing Then
u.Value = "0021"
bt.Click
End If
End Sub
另外我也试了,任何代码都不写,我只加载网页就像这样
webbrowser1.Navigate "http://******"。然后再点击里面的确定按钮也会出现同样的错误!
pDisp.Document.childnodes(2).getElementById("...")
因为网页不同所以数字也不一样
没有统一的解决方法,你到我百度空间上找到我的QQ,然后在QQ上告诉我你要访问的网址是多少,然后我再给你修改吧。这个要根据具体的网页内容才能编码