Page 2 of 2

Re: Saving OuterHTML using Await Implementation with TWebView

PostPosted: Fri Aug 18, 2023 8:38 pm
by Otto
Hello Charles,

In the past, I had some problems with SysWait().

I think you should use a timer.

viewtopic.php?f=3&t=36667&p=218689&hilit=syswait&sid=baaa9792d603f7acacf7427eeacfd234#p218689

I tested your suggestion with syswait in a loop, and it's consuming 25% of the CPU.

I can't recall precisely, but I believe it blocks the program.

Best regards,
Otto

Re: Saving OuterHTML using Await Implementation with TWebView

PostPosted: Sat Aug 19, 2023 10:36 am
by Enrico Maria Giordano
Try using SysRefresh() instead.

Re: Saving OuterHTML using Await Implementation with TWebView

PostPosted: Mon Aug 21, 2023 6:04 am
by CharlesKwon
Hello Otto.

SysWait() is not a timer. Could you please provide a detailed explanation of what it is used for? Alternatively, if you'd like, you can share your email, and I'll provide you with my WhatsApp contact.

Regards,
Charles KWON

Otto wrote:Hello Charles,

In the past, I had some problems with SysWait().

I think you should use a timer.

viewtopic.php?f=3&t=36667&p=218689&hilit=syswait&sid=baaa9792d603f7acacf7427eeacfd234#p218689

I tested your suggestion with syswait in a loop, and it's consuming 25% of the CPU.

I can't recall precisely, but I believe it blocks the program.

Best regards,
Otto

Re: Saving OuterHTML using Await Implementation with TWebView

PostPosted: Tue Aug 22, 2023 2:29 pm
by leandro
Listo ya logre integrar la clase a la aplicación, parece que el problema eran los puntos suspensivos que tiene código, según lo visto no son compatibles con xharbour.
Code: Select all  Expand view

    ::bOldBind := ::oWeb:bOnBind
    ::oWeb:bOnBind := { | cJson, cCalls, ... | ::GetBind( cJson, cCalls, ... ) } //<-ESTOS SON LOS QUE GENERABAN EL ERROR

    cEval := STRTRAN( cEval, "$QUERY$", cQuery )
   
    ::cReturn := ""
 


Por otro lado, Antonio, esta clase tambien va a ser incluida en el nuevo Build de FW?

Re: Saving OuterHTML using Await Implementation with TWebView

PostPosted: Wed Aug 23, 2023 1:24 am
by CharlesKwon
leandro,

If the ellipsis (...) doesn't work in xharbour, feel free to remove it. If the program I provided codes as desired, I would appreciate it if you could capture a screenshot and let me know.

Regards,
Charles KWON


leandro wrote:Listo ya logre integrar la clase a la aplicación, parece que el problema eran los puntos suspensivos que tiene código, según lo visto no son compatibles con xharbour.
Code: Select all  Expand view

    ::bOldBind := ::oWeb:bOnBind
    ::oWeb:bOnBind := { | cJson, cCalls, ... | ::GetBind( cJson, cCalls, ... ) } //<-ESTOS SON LOS QUE GENERABAN EL ERROR

    cEval := STRTRAN( cEval, "$QUERY$", cQuery )
   
    ::cReturn := ""
 


Por otro lado, Antonio, esta clase tambien va a ser incluida en el nuevo Build de FW?

Re: Saving OuterHTML using Await Implementation with TWebView

PostPosted: Wed Aug 23, 2023 2:31 pm
by Antonio Linares
leandro wrote:Listo ya logre integrar la clase a la aplicación, parece que el problema eran los puntos suspensivos que tiene código, según lo visto no son compatibles con xharbour.
Code: Select all  Expand view

    ::bOldBind := ::oWeb:bOnBind
    ::oWeb:bOnBind := { | cJson, cCalls, ... | ::GetBind( cJson, cCalls, ... ) } //<-ESTOS SON LOS QUE GENERABAN EL ERROR

    cEval := STRTRAN( cEval, "$QUERY$", cQuery )
   
    ::cReturn := ""
 


Por otro lado, Antonio, esta clase tambien va a ser incluida en el nuevo Build de FW?


Una vez os funcione bien, podemos incluirla en FWH

Re: Saving OuterHTML using Await Implementation with TWebView

PostPosted: Wed Aug 23, 2023 3:16 pm
by leandro
Charles de momento hicimos funcionar tu ejemplo...

En el transcurso de la semana voy a empezar a usar la clase mas a fondo. Apenas tenga otra imagen con lo que hicimos tambien te la hare llegar.

Muchas gracias por el aporte

Image

Code: Select all  Expand view

FUNCTION GetOuterHtml( oDlg  )
   LOCAL cStr
   LOCAL nCounter := 0
   LOCAL lOk  := .f.

   oWebVw2 := TWebView():New( , oDlg:hWnd )
   oWebVw2:Navigate( "https://login.yahoo.com/" )

   SysWait()
   Sleep(3000)
   SysWait()
   
   WHILE .T.
     
      ++nCounter
      cStr := AWait_QuerySelector( oWebVw2, "document.readyState", 3000 )  

      IF cStr == "complete"
         lOk := .t.
         EXIT
      ENDIF      

      SysWait()

      IF nCounter == 10
         EXIT
      ENDIF  

   ENDDO

   IF !lOk
      MsgStop("Timeout! Try again")
      RETURN NIL
   ENDIF

   AWait_SetValue( oWebVw2, "#login-username", "leandro arevalo")
   AWait_Click( oWebVw2, "#login-signin" )

RETURN NIL
 

Re: Saving OuterHTML using Await Implementation with TWebView

PostPosted: Thu Aug 24, 2023 5:14 am
by CharlesKwon
leandro,
Gracias por compartir los resultados. Si surge algún problema durante el proceso, no dudes en informarme en cualquier momento, y haré lo posible por brindarte ayuda.

Regards,
Charles KWON



leandro wrote:Charles de momento hicimos funcionar tu ejemplo...

En el transcurso de la semana voy a empezar a usar la clase mas a fondo. Apenas tenga otra imagen con lo que hicimos tambien te la hare llegar.

Muchas gracias por el aporte

Image

Code: Select all  Expand view

FUNCTION GetOuterHtml( oDlg  )
   LOCAL cStr
   LOCAL nCounter := 0
   LOCAL lOk  := .f.

   oWebVw2 := TWebView():New( , oDlg:hWnd )
   oWebVw2:Navigate( "https://login.yahoo.com/" )

   SysWait()
   Sleep(3000)
   SysWait()
   
   WHILE .T.
     
      ++nCounter
      cStr := AWait_QuerySelector( oWebVw2, "document.readyState", 3000 )  

      IF cStr == "complete"
         lOk := .t.
         EXIT
      ENDIF      

      SysWait()

      IF nCounter == 10
         EXIT
      ENDIF  

   ENDDO

   IF !lOk
      MsgStop("Timeout! Try again")
      RETURN NIL
   ENDIF

   AWait_SetValue( oWebVw2, "#login-username", "leandro arevalo")
   AWait_Click( oWebVw2, "#login-signin" )

RETURN NIL
 

Re: Saving OuterHTML using Await Implementation with TWebView

PostPosted: Fri Aug 25, 2023 12:56 am
by leandro
Charles buenas noches como estas?

Que pena molestarte, pero nos surge la necesidad de eliminar algunos de los elementos DOM, no se si ya esta contemplado?

Al mismo tiempo tambien necesitamos recuperar algunos de los atributos de las etiquetas, no se si ya lo tengas implementado?, para el caso en cuestión, necesitamos recuperar y tambien actualizar el atributo data-dvr del input .

Code: Select all  Expand view

<input id='txt_cod' data-dvr='8'>777777</input>
 


De antemano gracias

Re: Saving OuterHTML using Await Implementation with TWebView

PostPosted: Fri Aug 25, 2023 7:50 am
by CharlesKwon
leandro

Buenas tardes.
¿Podría proporcionar una explicación detallada de exactamente qué funcionalidad debe ser implementada?


Regards,
Charles KWON


leandro wrote:Charles buenas noches como estas?

Que pena molestarte, pero nos surge la necesidad de eliminar algunos de los elementos DOM, no se si ya esta contemplado?

Al mismo tiempo tambien necesitamos recuperar algunos de los atributos de las etiquetas, no se si ya lo tengas implementado?, para el caso en cuestión, necesitamos recuperar y tambien actualizar el atributo data-dvr del input .

Code: Select all  Expand view

<input id='txt_cod' data-dvr='8'>777777</input>
 


De antemano gracias