Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Call web page, capture output as string?
Message
 
To
26/03/2005 12:20:49
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Web Services
Miscellaneous
Thread ID:
00999280
Message ID:
00999285
Views:
31
Hi Cetin,

Thanks for the great parsing info. I guess the area I am having difficulty in is actually making the call to the web site without loading a browser object.

This app is in VFP 7 and I am not seeing much in the way of HTTP functionality, maybe a later version does have that. I am also looking at Rick Strahls wwHTTP function, but I don't have that version of wwIPStuff yet, so I haven't tested.

Thanks again Cetin.

David


>>A customer has a web-based application that returns a simple text html string. I can call the web app from my browser, and the results are displayed.
>>
>>How can I programatically call the web page and (instead of displaying the output in a browser) capture the output as a string?
>>
>>Thanks very much in advance.
>>
>>David
>
>Something like this?
>
>Local m.myHTML,m.parsed
>myHTML=[This<br> is an <font color="red"><b>example</b></font><Hr>x2 < x3]
>*myHTML= FileToStr(GetFile('HTM'))
>parsed = ''
>oParser = Createobject('myParser',m.myHTML,@m.parsed)
>? m.Parsed
>*StrToFile(m.Parsed,'ParseResult.txt')
>
>Define Class myParser As Form
>  Add Object oWB As OleControl With ;
>    OleClass = 'Shell.Explorer'
>
>  Procedure Init
>  Lparameters tcHTML, tcParse
>  lcTemp = Sys(2015)+'.htm'
>  Strtofile(tcHTML,lcTemp)
>  With This.oWB
>    .Navigate2('file://'+Fullpath(lcTemp))
>    Wait window 'Parsing...' nowait
>    Do While .ReadyState # 4 && Wait for ready state
>    EndDo
>  Endwith
>  Erase (lcTemp)
>  tcParse = This.oWB.Document.body.innerText
>  Wait clear
>  Return .f.
>Endproc
>Enddefine
>
Cetin
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform