1

I want to download webpages for offline viewing. In particular, I want to download this webpage: The Leibniz entry on SEP, so I run the following in my terminal

wget -p -np https://plato.stanford.edu/entries/leibniz/

which is supposed to download the images, etc. needed to display the webpage, but without ascending to the parent directory.

However, some icons on the webpage are missing when I open the downloaded webpage. To be specific, the pictures below show some of the icons missing in the the downloaded webpage. (I get the same result from different browsers)

This is the top left of the original webpage:

original webpage

and this is the top left of the downloaded webpage:

downloaded webpage

I have figured out that all the icons that are missing are from a font called "Font Awesome". When wget download the webpage it does provide me with a subdirectory called "font" which contains files with names containing the string "fontawesome", so wget does recognise that the webpage uses this font somehow.

Does anyone know why the icons doesn't show in the downloaded webpage?

2
  • I don't suppose the images are in a parent directory?
    – Jeff Schaller
    May 27 '20 at 17:32
  • I get the same result without the -np flag.
    – Tom
    May 27 '20 at 17:34
0

Problem is that wget saves font name with full query string, so you've got fontawesome-webfont.ttf?v=3.2.1

On the other hand browser, when making request throws off query string part (?v=3.2.1) and tries to request only fontawesome-webfont.ttf.

TBH I don't know "who is to blame" - wget or browser.

You can fix those icons by simply making link of fontawesome-webfont.ttf?v=3.2.1 file as fontawesome-webfont.ttf.

This is not new problem. Somebody else encountered this scenario https://gist.github.com/pigeonflight/f8d5d6efbadf8cb341d6a44d17de3d59 (funny - it is the same font!).

Mine solution for this problem is to avoid unix file naming schema by using option --restrict-file-names=windows. This forces wget to use, among many others things (see manual), @ mark instead of ? which does job right.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.