Reputation: 141
I have an HTML file that contains a bunch of links to an entire database. But the URLs are all written as:
<a href=/bw/examplefile.html>
When I try and use wget to download all of the links, I use the --base parameter to set the URL but it doesn't seem to work all that well. So, instead of fiddling with something I know I won't use again I just wanted to know how to add a URL to each link object easily in emacs.
I'm using Aquamacs on a Mac. Not sure if that makes all too much of a difference, but it may be useful info.
Upvotes: 2
Views: 112
Reputation: 73365
I expect the following is what you want, to turn your relative URLs into absolute URLs (and add the attribute quotes, which is a little nicer).
M-x replace-regexp
RET <a href=\(.+?\)>
RET <a href="http://example.com\1">
RET
Upvotes: 4