Page 1 of 1

get URL returns html source, not displayed text

Posted: Sun Nov 18, 2012 8:17 am
by david@ninetrees.com
when doing a get URL "" request, I was surprised that it returned the source of the web page.
How do I return the viewed text of the web page?
Thanks.

Code: Select all

on mouseUp
   get URL "..."
   put line 1 to 30 of it into field "textHolder"
 end mouseUp

Re: get URL returns html source, not displayed text

Posted: Sun Nov 18, 2012 11:40 am
by paulsr
david@ninetrees.com wrote:when doing a get URL "" request, I was surprised that it returned the source of the web page.
How do I return the viewed text of the web page?
Thanks.

Code: Select all

on mouseUp
   get URL "..."
   put line 1 to 30 of it into field "textHolder"
 end mouseUp
David, that's what get url is supposed to do. It gets the raw file. You need to strip out the html tags with something like:

Code: Select all

on mouseUp
   get URL "..."
   set the htmlText of fld "textHolder" to line 1 to 30 of it
 end mouseUp
[/quote]

You'll get the text without the tags, but it still may not be quite what you want, because without the html para breaks, what is a "line"?

But I think this shd help.

--paul