Get text from URL- put into field

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Ron Zellner
Posts: 106
Joined: Wed May 31, 2006 9:56 pm
Contact:

Get text from URL- put into field

Post by Ron Zellner » Mon Apr 05, 2010 10:41 pm

I have been trying to get the text content of a standard web page and display it in a stack (in a field)
I found: set the htmlText of field "FromWebSite" to URL "http://www.xxxxx"

But that puts the actual code in the field- How do I display only the text content that is in the code?

Thanks.

Ron

Ron Zellner
Posts: 106
Joined: Wed May 31, 2006 9:56 pm
Contact:

Re: Get text from URL- put into field

Post by Ron Zellner » Tue Apr 06, 2010 12:23 am

Actually, I have lot of the web page content displayed in the field, but I also get extraneous code as well.
Is it possible to select content within elements (e. g. Divs, or elements with ID names)?

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1239
Joined: Sat Apr 08, 2006 1:10 pm
Contact:

Re: Get text from URL- put into field

Post by BvG » Wed Apr 07, 2010 1:53 am

the htmltext of a field is not the same as xhtml 4.1 strict. It's not even html 1.0 for all I know. It's RevTML, so to say. As for your question, the only way is to parse the text in a repeat loop, or to copy/paste the text from a browser object.
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

Post Reply