Re: Removing html tags
Re: Removing html tags
- Subject: Re: Removing html tags
- From: "Marc K. Myers" <email@hidden>
- Date: Mon, 28 Feb 2005 15:19:10 -0500
On Feb 28, 2005, at 1:34 PM, Paff <email@hidden> wrote:
I want to remove all html tags from a document downloaded with curl
utility. I want to remove everything that is between <> characters
(including <> chars) so I end up with plain text. Example: if in a
document there's "<title>BOS Bank</title>" I'd like to get only "BOS
Bank"; if there's "<TD class="tabelka01" rowspan="2"
align="center">Kod</TD>" I want to get only "Kod" string etc.
set theText to "<tag1>this is some text</tag1> and then there's this
text followed by <tag2>and <tag3>its</tag3> contents</tag2>"
set {od, AppleScript's text item delimiters} to ¬
{AppleScript's text item delimiters, "<"}
set theText to text items of theText
set newText to ""
set AppleScript's text item delimiters to ">"
repeat with anItem in theText
set newList to text items of anItem
if (count newList) > 1 then
set newText to newText & text item 2 of newList
end if
end repeat
set AppleScript's text item delimiters to od
newText
-->"this is some text and then there's this text followed by and its
contents"
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden