我在vb.net程序的工作,我要点击网页上的超链接,来源是这样的:Vb.net点击链接查找字符串!
<a href="user_messages_view.php?id=23112">messages for Today, 2010-10-19 </a>
我要每天检查一下呢!
我试着用下面的方法点击(两者不能点击链接!):
Dim theElementCollection As HtmlElementCollection
Dim ctrlIdentity As String
theElementCollection = WebBrowser1.Document.GetElementsByTagName("a")
For Each curElement As HtmlElement In theElementCollection
ctrlIdentity = curElement.GetAttribute("innerText").ToString
If ctrlIdentity = Today.Date.ToString(Today.Date.ToString("dd")) Then
curElement.InvokeMember("click")
End If
Next
,我想这也代码:
If Me.WebBrowser1.Document.Links(i).InnerHtml.Contains(Today.Date.ToString("dd")) Then
Me.WebBrowser1.Document.Links(i).InvokeMember("Click")
End If
Next
任何帮助,将不胜感激!谢谢!
这是一个Forms应用程序或ASP .NET应用程序吗? – 2010-10-19 16:52:38
这是表单应用程序.net – Beho86 2010-10-19 17:41:32