在vb.net中的Awesomium点击事件

时间:2015-05-18 09:43:55

标签: vb.net click awesomium

 For Each link As HtmlNode In doc2.DocumentNode.SelectNodes("//div")
  if link.id="first album" then
           'this code needed'
  end if
 next

上面的代码找到了我需要的按钮,但是如何点击这个按钮呢?

1 个答案:

答案 0 :(得分:0)

以下代码成功。

For Each link As HtmlNode In doc2.DocumentNode.SelectNodes("//div")
    If link.id = "first album" Then
        xpath = link.xpath
        Dim nlink As JSObject = WebControl1.ExecuteJavascriptWithResult([String].Format("document.evaluate(""{0}"", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue", xpath))
            nlink.InvokeAsync("click")
    End If
Next