A couple of months ago, Lethalman posed a question on how to extract
descriptions to href links in a web page. Within hours (if not minutes) a
few of the hares of the list (Carl Read, Gabrielle and Sunanda spring to
mind) helped him along in the right direction.
 
Well in my tortoise-like way, I've come up with a one-line solution for
Lethalman :
 
>> lethal: {<a href="HYPERLINK
"http://bla";>Test</a><a"http://bla";>Test</a><a href="HYPERLINK
"http://blabla";>Test2</a"http://blabla";>Test2</a>}
== {<a href="HYPERLINK "http://bla";>Test</a><a"http://bla";>Test</a><a
href="HYPERLINK "http://blabla";>Test2</a"http://blabla";>Test2</a>}

>> foreach [desc] extract-web-links/only-descriptions lethal [print desc]
Test
Test2
 
You may have noticed that I had to write a short function extract-web-links
to get it down to one line. For what it's worth I've uploaded the function
to the Library.
 
Writing the function is part of my snail-paced learning of Rebol. I used it
primarily to make sure that I got a grip on series so I avoided use of
parse, load/markup and the like. It's probably much longer and much slower
than necessary.
 
Peter
 

-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.296 / Virus Database: 265.6.0 - Release Date: 17/12/2004
 


-- 
To unsubscribe from the list, just send an email to rebol-request
at rebol.com with unsubscribe as the subject.

Reply via email to