lo que puedes hacer es capturar el source de la pagina web o xml, lo que recoge la funcion GetUrl es els ource de la pagina como un Blob que despues puedes convertir a texto guardandolo en un archivo usando Filewrite luego podrías recorrer el archivo creado buscando por una cadena de texto especifica y a partir de ahi hacer un mid para extraer la parte del texto que te interesa.
aqui te dejo un ejemplo que extrae desde un xml en linea el tipo de cambio para dolares canadienses a euros.
esta hecho en PB7.
---- copia esto en un archivo de texto y luego importalo a una PBL
$PBExportHeader$nc_internet_results.sru
forward
global type nc_internet_results from internetresult
end type
end forward
global type nc_internet_results from internetresult
end type
global nc_internet_results nc_internet_results
forward prototypes
public function integer internetdata (blob data)
end prototypes
public function integer internetdata (blob data);long ll_fhandle
MessageBox("Returned HTML", String(data))
ll_fhandle = FileOpen("data.dat", StreamMode!, Write!, LockWrite!, Replace!)
filewrite(ll_fhandle, data)
fileclose(ll_fhandle)
return 1
end function
on nc_internet_results.create
call super::create
TriggerEvent( this, "constructor" )
end on
on nc_internet_results.destroy
TriggerEvent( this, "destructor" )
call super::destroy
end on
---- copia esto en un archivo de texto y luego importalo a una PBL
$PBExportHeader$w_euros.srw
forward
global type w_euros from window
end type
type p_1 from picture within w_euros
end type
type st_2 from statictext within w_euros
end type
type st_1 from statictext within w_euros
end type
type sle_1 from singlelineedit within w_euros
end type
type sle_2 from singlelineedit within w_euros
end type
type cb_13 from commandbutton within w_euros
end type
type sle_3 from singlelineedit within w_euros
end type
end forward
global type w_euros from window
integer width = 1966
integer height = 596
boolean titlebar = true
string title = "Oficial Exchange Rate from Canadian Bank"
boolean controlmenu = true
boolean minbox = true
boolean maxbox = true
boolean resizable = true
long backcolor = 12632256
string icon = "C:\Applications\Euro.ico"
p_1 p_1
st_2 st_2
st_1 st_1
sle_1 sle_1
sle_2 sle_2
cb_13 cb_13
sle_3 sle_3
end type
global w_euros w_euros
on w_euros.create
this.p_1=create p_1
this.st_2=create st_2
this.st_1=create st_1
this.sle_1=create sle_1
this.sle_2=create sle_2
this.cb_13=create cb_13
this.sle_3=create sle_3
this.Control[]={this.p_1,&
this.st_2,&
this.st_1,&
this.sle_1,&
this.sle_2,&
this.cb_13,&
this.sle_3}
end on
on w_euros.destroy
destroy(this.p_1)
destroy(this.st_2)
destroy(this.st_1)
destroy(this.sle_1)
destroy(this.sle_2)
destroy(this.cb_13)
destroy(this.sle_3)
end on
type p_1 from picture within w_euros
integer x = 1481
integer y = 40
integer width = 123
integer height = 88
string picturename = "C:\Applications\64Euro.jpg"
boolean focusrectangle = false
end type
type st_2 from statictext within w_euros
integer x = 169
integer y = 188
integer width = 594
integer height = 64
integer textsize = -10
integer weight = 700
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 32768
long backcolor = 12632256
string text = "1 Canadian Dollar ="
boolean focusrectangle = false
end type
type st_1 from statictext within w_euros
integer x = 151
integer y = 316
integer width = 608
integer height = 64
integer textsize = -10
integer weight = 700
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 32768
long backcolor = 12632256
string text = "Exchange Rate Date:"
boolean focusrectangle = false
end type
type sle_1 from singlelineedit within w_euros
integer x = 763
integer y = 320
integer width = 485
integer height = 84
integer taborder = 80
integer textsize = -10
integer weight = 700
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 32768
long backcolor = 12632256
boolean border = false
end type
type sle_2 from singlelineedit within w_euros
integer x = 768
integer y = 192
integer width = 379
integer height = 80
integer taborder = 80
integer textsize = -10
integer weight = 700
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 32768
long backcolor = 12632256
boolean border = false
end type
type cb_13 from commandbutton within w_euros
integer x = 1467
integer y = 28
integer width = 402
integer height = 112
integer taborder = 10
integer textsize = -8
integer weight = 700
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
string text = " Retrieve"
end type
event clicked;String ls_Headers, ls_URL,ls_args, ls_text
Long ll_Length, filehnd, ll_pos
Inet iinet_1
Blob lblob_args
integer result
nc_internet_results iir_Results1
This.GetContextService("Internet", iinet_1 )
iir_Results1 = CREATE nc_internet_results
ls_URL= "http://"+sle_3.text
ls_args = ""
lblob_args = Blob(ls_args)
ll_Length = Len(lblob_args)
ls_Headers = "Content-Length: " + String(ll_Length) + "~n~n"
//iinet_1.PostURL( ls_URL, lblob_args, ls_Headers, iir_Results1 )
iinet_1.GetURL( ls_URL, iir_Results1 )
filehnd = FileOpen("data.dat", LineMode!, Read!)
result = 0
do
result = fileread(filehnd,ls_text)
ll_pos = pos(ls_text,"date")
if ll_pos > 0 then
ls_text = mid(ls_text, ll_pos + 5,10)
sle_1.text = ls_text
end if
ll_pos = pos(ls_text,"EUR")
if ll_pos > 0 then
ls_text = mid(ls_text, ll_pos - 7,6)
if isnumber(ls_text) then
sle_2.text = ls_text + " EUR"
end if
end if
loop while Result <> -100
fileclose(filehnd)
ll_length = 0
end event
type sle_3 from singlelineedit within w_euros
integer x = 23
integer y = 24
integer width = 1422
integer height = 112
integer taborder = 70
integer textsize = -10
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 8388608
string text = "www.bankofcanada.ca/rss/fx/noon/eurocae01.xml"
borderstyle borderstyle = stylelowered!
end type
--------------------------------
o si prefieres dame tu email y te envio la pbl directamente