How can I write an Emacs Lisp function to find all hrefs in an HTML file and extract all of the links?
Input:
<html> <a href="http://www.stackoverflow.com" _target="_blank">StackOverFlow</a> <h1>Emacs Lisp</h1> <a href="http://news.ycombinator.com" _target="_blank">Hacker News</a> </html>
Output:
http://www.stackoverflow.com|StackOverFlow http://news.ycombinator.com|Hacker News
I've seen the re-search-forward function mentioned several times during my search. Here's what I think that I need to do based on what I've read so far.
(defun extra-urls (file)
...
(setq buffer (...
(while
(re-search-forward "http://" nil t)
(when (match-string 0)
...
))