Recursive download of subfolder with wget - --no-parent apparently not working

I need some documentation about XUL but I do not have Internet access most of the time. So, I've tried to download the Mozilla Tutorial with the following command:

wget --no-parent -r -l 2 -p -k 

My intention was to download both the page and its subpages (for example, ). However, even though I passed the --no-parent flag, it keeps getting pages such as .

I do not understand why it happens. How could I achieve the behavior I intended?

3 Answers

You need the trailing slash at the end of the URL.

5

Was having a similar issue:

wget -r -l1 --no-parent -nH "" 

I believe there was an issue with https vs. http. I updated $HOME/.wgetrc to:

header = Accept-Encoding: none header = Accept-Language: en-us,en;q=0.5 header = Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 header = Connection: keep-alive user_agent = Mozilla/5.0 (Windows NT 5.1; rv:10.0.2) Gecko/20100101 Firefox/10.0.2 referer = robots = off 

Then changed changed https to http:

wget -r -l1 --no-parent -nH "" 

The wget program no longer created folders (or retrieved files) from outside the specified directory hierarchy.

1

I had to disable gzip compression to make it work. I also changed the user-agent because some pages forbid wget. So this is what I've put into my .wgetrc:

header = Accept-Encoding: none

user_agent = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6

Works great here.

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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

You Might Also Like