vb2010のwebbrowserでframe内のリンクをクリックするのには

解決


永吉  2012-12-01 00:39:07  No: 103393

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


魔界の仮面弁士  2012-12-03 20:16:05  No: 103394

板違いです。隣の掲示板に移動をお願いします。


永吉  2012-12-03 22:50:37  No: 103395

.Document.Window.Frames(1).Document.Links(1).InvokeMember("CLICK")
で起動しました。


※返信する前に利用規約をご確認ください。

※Google reCAPTCHA認証からCloudflare Turnstile認証へ変更しました。






  このエントリーをはてなブックマークに追加