# The Best Way To Download A Website For Offline Use By Using Wget

**URL:** <https://onehack.st/t/the-best-way-to-download-a-website-for-offline-use-by-using-wget/135158>\
**Category:** Tutorials & Methods\
**Tags:** tools, downloaders\
**Created:** [October 7, 2020, 1:56pm UTC](https://onehack.st/t/the-best-way-to-download-a-website-for-offline-use-by-using-wget/135158 "2020-10-07T13:56:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prometheus](https://onehack.st/user_avatar/onehack.st/prometheus/32/34950_2.png) [@Prometheus](https://onehack.st/u/Prometheus)\
**Post date:** [October 7, 2020, 1:56pm UTC](https://onehack.st/t/the-best-way-to-download-a-website-for-offline-use-by-using-wget/135158/1 "2020-10-07T13:56:28Z")

</div>

![image](https://onehack.st/uploads/default/original/3X/f/5/f5e88914beb22b159854285c1f8f3026bc262c75.jpeg)

There are two ways - the first way is just one command run plainly in front of you; the second one runs in the background and in a different instance so you can get out of your ssh session and it will continue.

First make a folder to download the websites to and begin your downloading: (note if downloading `www.SOME_WEBSITE.com`, you will get a folder like this: `/websitedl/www.SOME_WEBSITE.com/`)

### STEP 1:

```auto
mkdir ~/websitedl/ 
cd ~/websitedl/

```

Now choose for Step 2 whether you want to download it simply (1st way) or if you want to get fancy (2nd way).

### STEP 2:

#### 1st way:

```auto
wget --limit-rate=200k --no-clobber --convert-links --random-wait -r -p -E -e robots=off -U mozilla http://www.SOME_WEBSITE.com

```

#### 2nd way:

##### TO RUN IN THE BACKGROUND:

```auto
nohup wget --limit-rate=200k --no-clobber --convert-links --random-wait -r -p -E -e robots=off -U mozilla http://www.SOME_WEBSITE.com &

```

##### THEN TO VIEW OUTPUT (there will be a nohup.out file in whichever directory you ran the command from):

```auto
tail -f nohup.out

```

#### WHAT DO ALL THE SWITCHES MEAN:

`--limit-rate=200k` limit download to 200 Kb /sec

`--no-clobber` don’t overwrite any existing files (used in case the download is interrupted and resumed).

`--convert-links` convert links so that they work locally, off-line, instead of pointing to a website online

`--random-wait` random waits between download - websites dont like their websites downloaded

`-r` recursive - downloads full website

`-p` downloads everything even pictures (same as --page-requsites, downloads the images, css stuff and so on)

`-E` gets the right extension of the file, without most html and other files have no extension

`-e robots=off` act like we are not a robot - not like a crawler - websites dont like robots/crawlers unless they are google/or other famous search engine

`-U mozilla` pretends to be just like a browser Mozilla is looking at a page instead of a crawler like wget

#### PURPOSELY **DIDN’T** INCLUDE THE FOLLOWING:

`-o=/websitedl/wget1.txt` log everything to wget\_log.txt - didn’t do this because it gave me no output on the screen and I don’t like that.

`-b` runs it in the background and I can’t see progress… I like “nohup &” better

`--domain=steviehoward.com` didn’t include because this is hosted by Google so it might need to step into Google’s domains

`--restrict-file-names=windows` modify filenames so that they will work in Windows as well. Seems to work okay without this.

###### tested with zsh 5.0.5 (x86\_64-apple-darwin14.0) on Apple MacBook Pro (Late 2011) running OS X 10.10.3

# 

_Source: gist.github, @stvhwrd_

---

<div class="post-metadata">

**Author:** ![maamiradina](https://onehack.st/user_avatar/onehack.st/maamiradina/32/26153_2.png) [@maamiradina](https://onehack.st/u/maamiradina)\
**Post date:** [October 7, 2020, 4:01pm UTC](https://onehack.st/t/the-best-way-to-download-a-website-for-offline-use-by-using-wget/135158/2 "2020-10-07T16:01:55Z")

</div>

> [@Prometheus](#):
>
> There are two ways - the first way is just one command run plainly in front of you; the second one runs in the background and in a different instance so you can get out of your ssh session and it will continue.
> 
> First make a folder to download the websites to and begin your downloading: (note if downloading `www.SOME_WEBSITE.com`, you will get a folder like this: `/websitedl/www.SOME_WEBSITE.com/`

Why you started from a very hard way?  
I am using Command promopt in windows 7 , and that tells that your command is invalid? so how we can use wget?

---

<div class="post-metadata">

**Author:** ![imanseptian](https://onehack.st/user_avatar/onehack.st/imanseptian/32/79904_2.png) [@imanseptian](https://onehack.st/u/imanseptian)\
**Post date:** [October 7, 2020, 10:26pm UTC](https://onehack.st/t/the-best-way-to-download-a-website-for-offline-use-by-using-wget/135158/3 "2020-10-07T22:26:35Z")

</div>

You can get wget in this site: [https://www.gnu.org/software/wget/](https://www.gnu.org/software/wget/)

---

<div class="post-metadata">

**Author:** ![maamiradina](https://onehack.st/user_avatar/onehack.st/maamiradina/32/26153_2.png) [@maamiradina](https://onehack.st/u/maamiradina)\
**Post date:** [October 8, 2020, 4:04pm UTC](https://onehack.st/t/the-best-way-to-download-a-website-for-offline-use-by-using-wget/135158/4 "2020-10-08T16:04:45Z")

</div>

I have downloaded and install it, but how i will use it.?
