VB2010でwebbrowserを用いてframe内のリンク先を自動的にクリックしたいのですがどなたかご指導下さい。
テストURLはhttp://technique.eweb-design.com/sample/6_2_frame.htmlを使用して以下のソースを作成しました。frame(1)のlink(1)をクリックするにはどうすればいいのでしょうか。よろしくお願いします。
Public Class Form1
Dim sno As Integer = 0
Private Sub WebBrowser1_DocumentCompleted(sender As System.Object, e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
Dim elem As HtmlElement
With WebBrowser1
.ScriptErrorsSuppressed = True
sno = sno + 1 : If sno < 4 Then Exit Sub
MsgBox("Text:" & .Document.Window.Frames(1).Document.Links(1).InnerText)
'.Document.Window.Frames(1).Document.Links(1).click()???
End With
End Sub
End Class
板違いです。隣の掲示板に移動をお願いします。
.Document.Window.Frames(1).Document.Links(1).InvokeMember("CLICK")
で起動しました。
ツイート | ![]() |