FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Read HTML page
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM

Read HTML page

Posted: Sun May 18, 2008 07:29 AM
Hi, all !

I open HTML page

oActiveX:=TActiveX():New( oWnd, "Shell.Explorer" ) 
oWnd:oClient:=oActiveX 
oActiveX:Do( "Navigate2", cMyURL )


It is possible read/write controls of page (Gets, tables. Events press button/menu) from FWH
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

Read HTML page

Posted: Sun May 18, 2008 08:00 AM

You can manage the events that you receive from the ActiveX.

Please review fwh\samples\WebExp.prg source code

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM

Read HTML page

Posted: Sun May 18, 2008 08:49 AM

Thank, Antonio !

But I not understand how I can read content of get field ?

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

Read HTML page

Posted: Sun May 18, 2008 08:59 AM

You need to search in Google for properties and methods documentation for "Shell.Explorer" ActiveX

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

Read HTML page

Posted: Sun May 18, 2008 09:08 AM
If you have Office installed, then go to its VB editor (Macros) and open a project. There you can place a WebBrowser object and find a lot of usefull information:
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

Read HTML page

Posted: Sun May 18, 2008 09:12 AM

Once seen some of its properties, then its easier to search in Google :-)

http://msdn.microsoft.com/en-us/library ... ument.aspx

http://msdn.microsoft.com/en-us/library ... ument.aspx

I guess "document" is the property that you need to manage

http://msdn.microsoft.com/en-us/library ... tbyid.aspx

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM

Read HTML page

Posted: Sun May 18, 2008 09:25 AM
Posts: 729
Joined: Tue Oct 18, 2005 06:49 PM

Read HTML page

Posted: Tue Nov 18, 2008 01:53 AM

Natter,
Did you resolve how to pass a value to a GET field into a webpage?
Can you share your experience?

Regards,

George

Posts: 1286
Joined: Mon Feb 25, 2008 02:54 PM

Read HTML page

Posted: Tue Nov 18, 2008 10:18 AM

DEFINE WINDOW oWndnet MDICHILD OF oWnd vscroll icon oico TITLE ".:: Internet ::. "+alltrim(cENDE)

DEFINE BUTTONBAR oBarnet size 34,34 3D OF oWndnet
DEFINE BUTTON OF oBarnet resource "B1" NOBORDER ACTION( oActiveX:Do( "GoBack" ) ) MESSAGE "Voltar" tooltip "Voltar"
DEFINE BUTTON OF oBarnet resource "B2" NOBORDER ACTION( oActiveX:Do( "GoForward" ) ) MESSAGE "Avançar" tooltip "Avançar"
DEFINE BUTTON OF oBarnet resource "STOP2" NOBORDER ACTION( oActiveX:Do( "ExecWB",23,1 ) ) MESSAGE "Parar" tooltip "Parar"
DEFINE BUTTON OF oBarnet resource "REFRESH" NOBORDER ACTION( oActiveX:Do( "ExecWB",22,1 ) ) MESSAGE "Atualizar" tooltip "Atualizar"
DEFINE BUTTON OF oBarnet resource "SAVE2" NOBORDER ACTION( oActiveX:Do( "ExecWB", 4,1 ) ) MESSAGE "Salvar como" tooltip "Salvar como"
DEFINE BUTTON OF oBarnet resource "PRINT10" NOBORDER ACTION( oActiveX:Do( "ExecWB", 7,1 ) ) MESSAGE "Imprimir" tooltip "Imprimir"
DEFINE BUTTON OF oBarnet resource "QUIT2" NOBORDER ACTION( oWndnet:End() ) MESSAGE "Fechar" tooltip "Fechar"
oBarnet:bRClicked := { || ( NIL ) }

@ 0.7,42.5 say "Endereço:" of oBarnet size 50,18 font oFontenet
@ 0.7,38.5 btnget ocamnet var cENDE of oBarnet size 300,19 font oFontenet valid (if(GetKeyState( VK_RETURN ),obotnet:setfocus(),),.t.)
@ 0.4,102 buttonbmp obotnet PROMPT SPACE(5)+"&Ir" of oBarnet bitmap "SETA" size 50,22 TEXTRIGHT font oFontenet action(grava_parametro('FWULTIMOEMAIL',alltrim(cEnde)),oWndnet:ctitle(".:: Internet ::. "+alltrim(cENDE)), oActiveX:Do( "Navigate", alltrim(cENDE) ),cPesq:=space(100),ocamne2:refresh())

@ 0.7,113 say "Pesquisa:" of oBarnet size 50,18 font oFontenet
@ 0.7,91 btnget ocamne2 var cPesq of oBarnet size 213,19 font oFontenet valid (if(GetKeyState( VK_RETURN ),obotpes:setfocus(),),.t.)
@ 0.4,157.6 buttonbmp obotpes PROMPT SPACE(5)+"&Ir" of oBarnet bitmap "GOOGLE" size 50,22 TEXTRIGHT font oFontenet action(oWndnet:ctitle(".:: Internet - Pesquisa ::. "+alltrim(cPesq)),if(empty(cPesq),msg("Nenhuma palavra foi digitada!"),GoogleSearch(AllTrim(STRTRAN(cPesq," ","+")),@cENDE,ocamnet)))

oActiveX := TActiveX():New( oWndnet, "Shell.Explorer" )
oActiveX:SetProp( "StatusBar", .t. )
oWndnet:oClient := oActiveX

ACTIVATE WINDOW oWndnet MAXIMIZED on init(ocamnet:setfocus(),oActiveX:Do( "Navigate", alltrim(cSite) ));
valid(oActiveX:end(),.t.)
return(.t.)


Function GoogleSearch(cAlgo,cENDE,ocamnet)


local hE, cVar1, cVar3,cLink

cVar1 := "http://www.google.com/search?q="
cVar3 := "&ie=UTF-8&oe=UTF-8&hl=pt&btnG=B%C3%BAsqueda+en+Google&lr="
cLink := cVar1+cAlgo+cVar3
oActiveX:Do( "Navigate", cLink)
cEnde := space(100)
ocamnet:refresh()
SysRefresh()
return nil

:)

ubiratanmga@gmail.com

FWH24.04
BCC7.3
HARBOUR3.2
xMate
Pelles´C
TDolphin
Posts: 729
Joined: Tue Oct 18, 2005 06:49 PM

Read HTML page

Posted: Tue Nov 18, 2008 03:45 PM

SGS

Thanks for sharing with us your code.
May you indicate the variables that are using your code?

Regards,

George

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

Read HTML page

Posted: Tue Nov 18, 2008 07:37 PM

George,

Do you mean to fill a GET or to supply a value as a parameter ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 729
Joined: Tue Oct 18, 2005 06:49 PM

Read HTML page

Posted: Tue Nov 18, 2008 08:29 PM
Antonio,

I mean to fill a GET with a value and click a button.
By example:
1) Go to www.whitepages.com
2) Go to the tab "Reverse Lookup" (to search Name and Address by the phone number)
3) Fill "Phone Number" GET field
4) Click on Search Button.

Last night I got a solution to this.
This is the code:

FUNCTION SearchNameByPhone(cPhone)
local oWnd, oActiveX, cMyUrl

cMyUrl := "www.whitepages.com/search/ReversePhone?full_phone="
cMyUrl := cMyUrl + alltrim(cPhone) 

      DEFINE WINDOW oWnd TITLE "Verifying Customer's Phone Number" ;
         FROM 5, 220 TO 725, 900 pixel

      oActiveX = TActiveX():New( oWnd, "Shell.Explorer.2" )
      oWnd:oClient = oActiveX 

      oActiveX:Do( "Navigate", cMyURL )
      sysrefresh()

      ACTIVATE WINDOW oWnd 

      sysrefresh()

RETURN (.T.)



Regards,

George
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

Read HTML page

Posted: Tue Nov 18, 2008 09:02 PM

George,

good solution! :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion