我在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