How do we extract the URL address of a particular link in the html document?

Do we use string operation to find the word "href" before the text link, and then get the url address following href, or can we use other better methods?

Using string operation to get the url address is quite cumbersome.

We'll need to deal with absolute/relative link, and not to mention a cgi link.

Rgds,
Greg