In the app I'm writing, the user supplies a web address, which's contents are then loaded into a string. What I'm trying to do is extract links from this string, that is:
<a href="http://www.google.com">Google</a>
becomes:
Google
http://www.google.com
The problem is -- as I didn't know before I adapted Apple's sample NSScanner code (which works fine for this format of link) -- is that there are about a dozen or more different kinds of links, as near as I can tell (that is, it almost never looks like the example above).
Yet every web browser displays links the same way, as a segment of underlined text linking to an address, and omniWeb even has a little utility window which extracts all the links from a page.
My question: before I struggle with reinventing the wheel to deal with each and every kind of link, is there any free html scanning code which I can pass a string and get this information out of?
Thanks. I've been looking on CocoaDev and CDC, with no avail.