Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

vb.net GetElementByid from already opened pages in internet explorer

$
0
0

im working on project (vb.net) that read text from website and save it to .sdf database and then print it out

so far i can read elements in the first internet explorer page that opened from my project , the first page has link to choice the language when i click on it it open another window (not tab) and here is my problem cuze i cannot read any elements value from the second internet explorer window

How i can tel my application which internet explorer window need to get elements value from ?

here is my code

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click

    ie = New SHDocVw.InternetExplorer
    With ie
        .Visible = True
        .Navigate("http://11.2.114.155/")
        Do Until Not .Busy And .ReadyState = 4
        Loop
        doc = ie.Document
    End With
    ie = Nothing
End Sub

Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click

        elements = doc.getElementsByName("AccountNo")
        elements1 = doc.getElementsByName("AcctTitle")
        elements2 = doc.getElementsByName("NamBenef")
        elements3 = doc.getElementsByName("TCY_Amount")
        elements4 = doc.getElementsByName("InstrDate")

        nachnameValueInput = elements(0)
        nachnameValueInput1 = elements1(0)
        nachnameValueInput2 = elements2(0)
        nachnameValueInput3 = elements3(0)
        nachnameValueInput4 = elements4(0)
 On Error Resume Next

        Dim DM1 As DataTable = ds.Tables("CheqDetail")
        Dim DM2 As DataView = DM1.DefaultView
        Dim DM As DataRowView = DM2.AddNew()
        Dim SQ As Integer = 1
        If dv.Count > 0 Then SQ = dv.Item(0).Item("SQ") + 1
        DM("SQ") = SQ

If IsDBNull(nachnameValueInput.getAttribute("Value").ToString) = False Then DM("AccNUM") = nachnameValueInput.getAttribute("Value").ToString If IsDBNull(nachnameValueInput1.getAttribute("Value").ToString) = False Then DM("AccNAM") = nachnameValueInput1.getAttribute("Value").ToString If IsDBNull(nachnameValueInput2.getAttribute("Value").ToString) = False Then DM("BinfNAM") = nachnameValueInput2.getAttribute("Value").ToString If IsDBNull(nachnameValueInput3.getAttribute("Value").ToString) = False Then DM("AmountNUM") = Val(nachnameValueInput3.getAttribute("Value").ToString)

   If IsDBNull(nachnameValueInput3.getAttribute("Value").ToString) = False Then DM("AmountCHR") = ConvertNumbersToWords(Convert.ToDecimal(Val(nachnameValueInput3.getAttribute("Value")).ToString), "دينار", "درهم", "فقط(", ")لاغير.")
        If IsDBNull(nachnameValueInput.getAttribute("Value").ToString) = False Then
            If IsDate(nachnameValueInput4.getAttribute("Value").ToString) = True Then
                DM("IssueDate") = nachnameValueInput4.getAttribute("Value").ToString
                Me.DateTimePicker1.Value = nachnameValueInput4.getAttribute("Value").ToString
            End If


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>