0

in my webpage i want wait while when HTMLdoc.getElementById("gen__1007") is not nothing

How can i do this?

Do Until IE.Busy = False: DoEvents: Loop Do Until IE.ReadyState = 4: DoEvents: Loop theese are not working...

acar6783
  • 23
  • 5
  • i'm getting error on this line, Set elements2 = HTML.querySelector("input[CLASS=csc-textbox]") – acar6783 Oct 10 '20 at 19:53
  • i didnt understan how can i do this with my codes – acar6783 Oct 10 '20 at 22:29
  • Look here: https://stackoverflow.com/questions/63943939/submitting-form-and-reading-results-using-excel-vba-and-internetexplorer/63979678#63979678 In the first linked example you can see how to implement a timeout. In the second example you can see how a loop works with `getElementByID()` – Zwenn Oct 11 '20 at 10:24

1 Answers1

0
Sub POPUP_CONTROL()
        Dim MSG_DIV = ""
        WEB_LOAD2.Text = ""
        TIME = 0
        Do
            Application.DoEvents()
            On Error Resume Next
            MSG_DIV = WebBrowser1.Document.GetElementById("pb-popup-message").InnerText 
            On Error GoTo 0  
            System.Windows.Forms.Application.DoEvents()
            WEB_LOAD2.Text = MSG_DIV
            If TIME >= 20 Then GoTo CIK 
        Loop While MSG_DIV = ""
        WEB_DURUM2.Text = "Loaded! " 
        Exit Sub
CIK: 
        MsgBox("NO INTERNET CONNECTION OR VERY SLOW " & vbLf & "TRY AGAIN LATER!" & vbLf, vbInformation, "ACR")

    End Sub

Where could I be making mistakes in the codes I wrote?

acar6783
  • 23
  • 5