以下代码,出现 对象不支持“find”属性或方法 错误,是什么原因,怎么正确写法?求助大神
Dim brw As WinForm.WebBrowser = e.Form.Controls("WebBrowser1")
brw.Address = “http://www.somsds.com/msds.asp”
Dim web As System.Windows.Forms.WebBrowser = brw.Basecontrol
Do Until web.ReadyState = 1
Application.DoEvents
Loop
Dim hec As System.Windows.Forms.HtmlElementCollection = web.Document.GetElementsByTagName("a")
For i As Integer = 0 To hec.Count-1 '循环所有A标签
If hec(i).OuterHtml.Contains("精确名称") Then '判断该A标签是否包含这个字符串(如果包含说明该A标签是登录按钮)
hec(i).InvokeMember("click") '执行该标签的点击方法,从而实现点击登录按钮
Exit For '既然已经找到了这个A标签,没有必须继续循环了.退出循环
End If
Next