如果网页中没有指定的html元素,如何停止计时器
Try
If WebBrowser1.ReadyState = WebBrowserReadyState.Complete Then
Dim Page As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("a")
For Each Element As HtmlElement In Page
If Element.GetAttribute("href").Contains("/email") Then
id = Element.GetAttribute("href").ToString()
If Not ListBox1.Items.Contains(id) Then
ListBox1.Items.Add(id)
End If
End If
Next
End If
catch ex As Exception
MessageBox.Show(ex.Message, "Error scraping", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
在上面的代码中列出了包含“email”的链接列表框如果链接包含“email”不存在,如何提醒或停止计时器