Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to mirror only a section of a website?

Tags:

wget

mirror

I cannot get wget to mirror a section of a website (a folder path below root) - it only seems to work from the website homepage.

I've tried many options - here is one example

wget -rkp -l3 -np  http://somewebsite/subpath/down/here/ 

While I only want to mirror the content links below that URL - I also need to download all the page assets which are not in that path.

It seems to work fine for the homepage (/) but I can't get it going for any sub folders.

like image 448
sub Avatar asked May 26 '11 22:05

sub


People also ask

How do mirror sites work?

A mirror site is a website or set of files on a computer server that has been copied to another computer server so that the site or files are available from more than one place. A mirror site has its own URL, but is otherwise identical to the principal site.


1 Answers

Use the --mirror (-m) and --no-parent (-np) options, plus a few of cool ones, like in this example:

wget --mirror --page-requisites --adjust-extension --no-parent --convert-links      --directory-prefix=sousers http://stackoverflow.com/users 
like image 122
Attilio Avatar answered Sep 18 '22 13:09

Attilio