NaviServer - programmable web server
4.99  5.0

[ Main Table Of Contents | Table Of Contents | Keyword Index ]

ns_hrefs(n) 4.99.30 naviserver "NaviServer Built-in Commands"

Name

ns_hrefs - Returns URLs from anchor elements in a chunk of HTML

Table Of Contents

Synopsis

Description

This command finds the anchor elements in a chunk of HTML, and returns a list of the URLs in those elements' href attributes.

COMMANDS

ns_hrefs html

EXAMPLES

 % set html {One good website is <A href='http://google.com/'>Google</A>.
            Another is <a href='http://www.yahoo.com'>Yahoo!</a>}
 
 % ns_hrefs $html
 http://google.com/ http://www.yahoo.com

Keywords

HTML, global built-in