Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Call web page, capture output as string?
Message
From
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:
00999284
Views:
37
>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&nbsp&lt&nbspx3]
*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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform