I have to scour a website and save all the pages as HTML and put it on a single DVD Will happen. I have done this, but now all the links start with a I have seen things about How can I do this in a skilled way? As I said above my comment, which device are you using on this site Depending on this, you can start with checking whether this link supports rewriting or not. I do not think Ugo MA Da's suggestions will work because your URLs are absolute, and the base tag only allows you to specify the basis for the relative URL: < Pre> /foo/bar.html: If you write again according to your suggestion, then it will be: But that will not work, because the browser will solve it on What I am trying to say is that the correct (rewritten) URL is always based on the location of the current file and target file. In short, I think your best bet is to use / , and it grabs my root directory. I will send all the files to all
href s (1500 Pages) to
href = "./" , so it always grabs the working directory.
sed about
bash , but I also did not catch that all the
href How to dynamically capture and change them.
wget will let you do this by going through the
-k option:
-k, --convert-links HTML or CSS points to the files.
href = uri [CT] This feature specifies a full URI which works as a base URI to resolve the relative URI. It is difficult to rewrite every
href because it is very difficult to know that you are doing the right thing - it depends on the structure of the site. Consider the following example:
& lt; A href = "/ bar / baz.html" & gt; Falcon & lt; / A & gt;
& lt; A href = "./ bar / baz.html" & gt; Baz & lt; / A & gt;
/foo/bar/baz.html , when the file actually contains
[some DIR] /bar/baz.html In that case, you really want:
& lt; A href = "../ bar / baz.html" & gt; Falcon & lt; / A & gt;
wget or any other tool that supports URL reconstruction, or just something like
sed And the need for advanced programs, which lacks context, is essential for converting links properly.
Comments
Post a Comment