mirror single page with httrack

31.1k views Asked by At

I am trying to use httrack (http://www.httrack.com/) in order to download a single page, not the entire site. So, for example, when using httrack in order to download www.google.com it should only download the html found under www.google.com along with all stylesheets, images and javascript and not follow any links to images.google.com, labs.google.com or www.google.com/subdir/ etc.

I tried the -w option but that did not make any difference.

What would be the right command?

EDIT

I tried using httrack "http://www.google.com/" -O "./www.google.com" "http://www.google.com/" -v -s0 --depth=1 but then it wont copy any images.

What I basically want is just downloading the index file of that domain along with all assets, but not the content of any external or internal links.

5

There are 5 answers

4
Kevin Reid On BEST ANSWER

Could you use wget instead of httrack? wget -p will download a single page and all of its “prerequisites” (images, stylesheets).

0
Gregory Pakosz On

The purpose of HTTTrack is to follow links. Try setting --ext-depth=0.

3
torger On

Looking at the example:

httrack "http://www.all.net/" -O "/tmp/www.all.net" "+*.all.net/*" -v

The last part is a regex. Just make a completely matching regex.

httrack "http://www.google.com.au/" -O "/tmp/www.google.com.au" "+*.google.com.au/*" -v ---depth=2 --ext-depth=2

I had to localise, otherwise I get a redirect page. You should localise to whichever google you get directed to.

0
Sourav Ghosh On
httrack "http://www.google.com/" -O "./www.google.com" "http://www.google.com/" -v -s0  --depth=1 -n

-n option (or --near) will download images on a webpage no matter where it is located.

Say images are located in google.com/foo/bar/logo.png. as, you are using s0(stay on same directory), it will not download the image unless you specify --near

1
Lucas Bustamante On
  • Click on "Set Options"
  • Go to the tab "Limits"
  • Set "Maximum external depth" to 0

copy one page only with httrack