单击没有ID的按钮

时间:2013-08-12 22:33:38

标签: .net vb.net button

大家好我已尝试过多种尝试点击按钮的方式,而id代码位于

之下
For Each Element As HtmlElement In WebBrowser1.Document.GetElementsByTagName("button")
  If Element.InnerText.Contains(" yt-uix-button yt-uix-button-primary yt-uix-button-   size-default") Then
    Element.InvokeMember("click")
    Exit For
  End If
 Next Element

error: Object reference not set to an instance of an object.

0 个答案:

没有答案