我尝试在网站上搜索特定词组,然后将该词组添加到textbox.text
。
这是我现在的代码,但它不起作用:
Dim theElementCollection As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("DIV")
For Each curElement As HtmlElement In theElementCollection
If curElement.GetAttribute("classname") = "alert alert-warning ng-binding ng-scope" Then
If curElement.OuterHtml.Contains("No Flex Visit could be found.") Then
txtMessage.Text = curElement.InnerText
End If
Else
End If
Next
我需要抓取的网址摘要:
<div ng-controller="FlexVisitController" class="ng-scope">
<!-- ngInclude: '/ng/flexVisit/views/flexVisitListView.htm?201612080346' -->
<div ng-include="'/ng/flexVisit/views/flexVisitListView.htm?201612080346'" class="ng-scope">
<!-- ngIf: flexVisitList.length == 0 -->
<div class="alert alert-warning ng-binding ng-scope" role="alert" ng-if="flexVisitList.length == 0">
No Flex Visit could be found.
</div>
<!-- end ngIf: flexVisitList.length == 0 -->
<!-- ngRepeat: project in flexVisitList -->
</div>
&#13;
所以,上面的网址表示如果flexVisitList
为0
,则显示消息:&#34;无法找到Flex访问。&#34;
我想要完成的是如果此消息在网站上,则添加到文本框中。
由于
乍得