Retrieve web page

Bringing the internet highway into your project? Building FTP, HTTP, email, chat or other client solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
lohill
Posts: 770
Joined: Tue Dec 08, 2009 6:37 pm

Retrieve web page

Post by lohill » Thu Jan 28, 2010 6:35 pm

I can use the following code to retrieve information from a web site but it is not quite what I want.

Code: Select all

on mouseUp
   put "http://finance.yahoo.com/q/pr?s=AAPL"  into myURL
   put url myURL into tData
   answer tData
end mouseUp
When tData is displayed (and I'm not sure I'm using the proper terminology here) it shows up as HTMl and the various links are active. When I put a break point at line 4 and look at tData in the IDE, it shows up as just plain text with all the HTMl codes in plain sight. Is there a command or function that can be used on tData to convert it to plain text for display?

Thanks in advance for any help you can give.
Regards,
Larry

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4163
Joined: Sun Jan 07, 2007 9:12 pm

Re: Retrieve web page

Post by bn » Thu Jan 28, 2010 9:15 pm

Larry,
answer can display a subset of html, that is why you get this in the answer field.
If you just want the html as plain text put it into a field. If you want to set the htmlText of a field you get the same as in the answer dialog.

Code: Select all

on mouseUp
   put "http://finance.yahoo.com/q/pr?s=AAPL"  into myURL
   put url myURL into tData
   put tData into field 1
   -- for htmlText format
   --set the htmlText of field 2 to tData
end mouseUp
regards
Bernd

lohill
Posts: 770
Joined: Tue Dec 08, 2009 6:37 pm

Re: Retrieve web page

Post by lohill » Thu Jan 28, 2010 10:51 pm

Thanks Bernd,

So that is actually a 'feature' of 'answer'. Had I looked at it almost any other way I would have seen plain plain text unless I had asked specifically for htmlText. Too simple. :D

Regards,
Larry

Post Reply