FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Saving OuterHTML using Await Implementation with TWebView
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: Saving OuterHTML using Await Implementation with TWebView
Posted: Fri Aug 18, 2023 08:38 PM
Hello Charles,

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

I think you should use a timer.
https://forums.fivetechsupport.com/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
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Saving OuterHTML using Await Implementation with TWebView
Posted: Sat Aug 19, 2023 10:36 AM

Try using SysRefresh() instead.

Posts: 28
Joined: Sun Nov 02, 2014 07:03 AM
Re: Saving OuterHTML using Await Implementation with TWebView
Posted: Mon Aug 21, 2023 06:04 AM
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.
https://forums.fivetechsupport.com/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
Posts: 1816
Joined: Wed Oct 26, 2005 02:49 PM
Re: Saving OuterHTML using Await Implementation with TWebView
Posted: Tue Aug 22, 2023 02:29 PM
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 (fw): Select all Collapse
聽 聽 ::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?
Saludos
LEANDRO AREVALO
Bogot谩 (Colombia)
https://hymlyma.com
https://hymplus.com/
leandroalfonso111@gmail.com
leandroalfonso111@hotmail.com

[ Turbo Incremental Link64 6.98 Embarcadero 7.70 ] [ FiveWin 25.01 ] [ xHarbour 64 bits) ]
Posts: 28
Joined: Sun Nov 02, 2014 07:03 AM
Re: Saving OuterHTML using Await Implementation with TWebView
Posted: Wed Aug 23, 2023 01:24 AM
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 (fw): Select all Collapse
聽 聽 ::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?
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Saving OuterHTML using Await Implementation with TWebView
Posted: Wed Aug 23, 2023 02:31 PM
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 (fw): Select all Collapse
聽 聽 ::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
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1816
Joined: Wed Oct 26, 2005 02:49 PM
Re: Saving OuterHTML using Await Implementation with TWebView
Posted: Wed Aug 23, 2023 03:16 PM
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


Code (fw): Select all Collapse
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
Saludos
LEANDRO AREVALO
Bogot谩 (Colombia)
https://hymlyma.com
https://hymplus.com/
leandroalfonso111@gmail.com
leandroalfonso111@hotmail.com

[ Turbo Incremental Link64 6.98 Embarcadero 7.70 ] [ FiveWin 25.01 ] [ xHarbour 64 bits) ]
Posts: 28
Joined: Sun Nov 02, 2014 07:03 AM
Re: Saving OuterHTML using Await Implementation with TWebView
Posted: Thu Aug 24, 2023 05:14 AM
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


Code (fw): Select all Collapse
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
Posts: 1816
Joined: Wed Oct 26, 2005 02:49 PM
Re: Saving OuterHTML using Await Implementation with TWebView
Posted: Fri Aug 25, 2023 12:56 AM
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 (fw): Select all Collapse
<input id='txt_cod' data-dvr='8'>777777</input>
De antemano gracias
Saludos
LEANDRO AREVALO
Bogot谩 (Colombia)
https://hymlyma.com
https://hymplus.com/
leandroalfonso111@gmail.com
leandroalfonso111@hotmail.com

[ Turbo Incremental Link64 6.98 Embarcadero 7.70 ] [ FiveWin 25.01 ] [ xHarbour 64 bits) ]
Posts: 28
Joined: Sun Nov 02, 2014 07:03 AM
Re: Saving OuterHTML using Await Implementation with TWebView
Posted: Fri Aug 25, 2023 07:50 AM
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 (fw): Select all Collapse
<input id='txt_cod' data-dvr='8'>777777</input>
De antemano gracias

Continue the discussion