Dim divhtml As System.Windows.Forms.HtmlElementCollection = web.Document.GetElementsByTagName("div") \'获得当前页面的div标签HTML元素集合
For i As Integer = 0 To divhtml.Count - 1 \'循环所有div标签
If divhtml(i).OuterHtml.Contains("myTabContent") Then \'myTabContent是成功登录后数据表的id
Exit For
End If
If divhtml(i).OuterHtml.Contains("知道了") Then \'判断该input标签是否包含这个字符串(如果包含说明该div标签是在弹窗里)
Dim tchtml As System.Windows.Forms.HtmlElementCollection = divhtml(i).GetElementsByTagName("div") \'在弹窗里获得下面的div标签HTML元素数组
tchtml(1).InvokeMember("click") \'点击该标签,从而消除提示框
Exit For
End If
Next
可发现上面的代码还是提取之前的div代码,应该是先提取了再执行了点击,请问这种情况怎么解决?