How To Get Wget For Your Mac

Mac wget 300x300 shutterstock 90628729   How To Get Wget For Your MacMacs are great, with their neat UI and a Unix back-end. Sometimes you get the feeling you can do just about anything with them. Until one day you’re trying to do something simple and you realise what you need is just not available natively. In this case, I’m talking about wget.

In case you don’t know, wget is an incredibly useful command-line tool to download whole webpages, including media and as much link depth as you require. It’s quite powerful and sophisticated and it comes in very handy when you’re trying to make backups – especially since it can be worked into scripts. It doesn’t take a Unix guru to get hold of it and use it, either. It can be yours in a few steps, which are just fiddly enough to warrant writing out.

Get The Wget Binary

This is a cheat method which might not be around forever and may not work for everyone – but it’s quick. A very kind soul called Quentin Stafford-Fraser has made a binary of wget for Mac OS X Leopard. Download the zip file and unzip it. Copy the wget file to /usr/local/bin (and follow the README instructions for the other files also).

If this hasn’t worked for you for some reason, read on.

Get a C/C++ Compiler For Your Mac

If you don’t already have a C/C++ compiler for your Mac, you’re going to need one. The easiest way to get them is to install Xcode from the Mac Developer tools, which is available for free on your OS install disc or for Lion via the Mac App Store.

If none of these are an option, install the appropriate package according to the instructions at hpc.sourceforge.net.

Get XZ Utils For Mac

The wget package comes as a xz compressed file and it’s sad, but true, that this format isn’t supported by the MacOS Unzip utility. So, go grab a copy of XZ Utils for Mac so that you can unzip the wget package when you get it.

Get Wget Package Using HTTP or FTP

Head to the wget page and download the wget package via HTTP or FTP or a mirror site which suits you. Download the most recent version you can find.

Unzip And Install Wget

Open up the Terminal application (Applications > Utilities > Terminal) and navigate to wherever the package was downloaded.

cd ~/Downloads

Unzip the file using XZ Utils and tar (replace the name of the file with whichever wget version you have downloaded):

xz -d wget-1.13.tar.xz
tar -xf wget-1.13.tar

Change into the new wget directory and run these commands in order:

cd wget-1.13
./configure
make
sudo make install

wget success shutterstock 34790428   How To Get Wget For Your Mac

Some Ideas For Using Wget

Wget can be used in any instance where you might use DownThemAll to get pictures, music or video in bulk from a website. It can also be used to backup entire websites and perhaps mirror them for preservation.

wget in action   How To Get Wget For Your Mac

If you’re still not sure what you might use Wget for, consider using Wget to back up your online photo directories or to grab MP3s from open folders online. Anywhere you know of where there’s a folder full of media or a page which links to or displays media can be downloaded with one command using Wget. Although it’s therefore possible to use Wget for entertainment you probably should have paid for, there are plenty of honourable uses for it.

For instance, if you work for a small company who are not so great with their backups, maybe you could use Wget in a script in order to back up your company website. When the inevitable day comes and the work server crashes, you’ll save the day by being able to pull up a recent backup. The same goes for your favourite community websites or anything run by amateurs: your kid’s footy club, the local drama group or whatever else you’re involved with.

Wget is especially good if everyone’s forgotten the password or if hackers changed your website password. Wget can grab all the important stuff for you and you can start fresh.

Using Wget

Here’s a quick example of a Wget command for creating a mirror all of the HTML and media from a page.

wget -m http://www.makeuseof.com/

It’s simple and effective, although I honestly don’t recommend trying this particular example at home!

Cool Scripts And Downloaders

If you’re into automation and downloading, here’s some more to read:

What do you use wget for? Let us know!

Image Credit: Download icon blue glass via Shutterstock, Man in wheat field joying via Shutterstock

The comments were closed because the article is more than 180 days old.

If you have any questions related to what's mentioned in the article or need help with any computer issue, ask it on MakeUseOf Answers—We and our community will be more than happy to help.

17 Comments -

0 votes

Gant Laborde

WOW, that’s a lot of effort for something that’s easy using homebrew!
http://mxcl.github.com/homebrew/

0 votes

Angela Alcorn

Thanks for sharing the link!

0 votes

Vaibhav Vgc

i am getting this at the end in terminal : configure: error: –with-ssl was given, but GNUTLS is not available.
help!!

0 votes
0 votes
0 votes

Angela Alcorn

Thanks for sharing this!

0 votes

Frank van Westerop

Don’t install GnuTLS, you would probably break your SSL stack. Most likely your box just uses some other SSL library, for instance OSX Lion 10.7 comes with OpenSSL. In general don’t install more than one SSL lib or you will break things. Just tell configure to use OpenSSL instead, in case you’re on Lion:

./configure –with-ssl=openssl

See also: http://crosstown.coolestguyplanettech.com/os-x/32-install-and-configure-wget-on-os-x-lion-107

0 votes

Anonymous

I’m pretty sure cURL can do a lot of what wget can. What situation would you need wget for in which cURL just isn’t enough? It’s always better to use a built-in solution. Publicly shared shell scripts will depend on cURL, not wget.

0 votes

Angela Alcorn

I haven’t really used cURL but I guess it does many of the same things. I think that sometimes people get attached to commands they can use well/quickly and like to stick with them where possible. Maybe also to run similar scripts across several OSs?

Who knows? I’m just helping them to get wget running if that’s what they’re after. :)

0 votes

Angela Alcorn

Homebrew’s another nice idea.

0 votes

SociApple

“Sometimes when you innovate, you make mistakes.” “It is better to admit them quickly, and keep on betting for your other innovations.” by Steve Jobs – Apple Social 

Network

0 votes

Aibek

second that

0 votes

Paul

When someone makes an effort to explain how to repair a leaking sunroof on a Toyota Landcruiser, why do people feel the urge to write responses like:

* “you should get a car with airconditioning”,
* “why don’t you drive a Mercedes, like ALL of us (in Stuttgart)”,
* “cars are bad”,
* “why not just take it to a mechanic”,
* “your Toyota is stupid”.

I like my Toyota, thank you.

Oh, and does anybody even remember why Apple removed Wget from OSX? or when?

Curl is for noobs.

0 votes

Svend Bakken

I was myself looking for wget for mac a while back, and stumbled upon this webpage:
http://www.techtach.org/wget-prebuilt-binary-for-mac-osx-lion
It has a link to the newest version of wget, and I found that the executable worked on both Snow Leopard and Lion.

0 votes

Angela Alcorn

Thanks, that looks useful!

0 votes

ilyse kazar

Warning: the wget binary instructions do not seem to apply at all to Snow Leopard. For example, the instructions say to install a component into /usr/local/man/man1 but the man’s on Snow Leopard are at /usr/share/man/man1. Also, on my Macbook 10.6.8 there is no usr/local/etc directory the instructions refer to, only /etc

I did my best with this script but it failed on Snow Leopard. This is not for anyone except those completely knowledgeable about the various directories inside Terminal. Not recommended even for everyday “power users” like me.

0 votes

ilyse kazar

further warning: the linked-to page for XZ utilities has all kinds of intimidating instructions for “making” the utility on your mac. There is also a link (on the XZ utilities page) to an installable package made by someone. I downloaded that .dmg and ran the installer, but when I double-click on the wget-1.13.tar.xz file and it asks me to choose what application to decompress it, there is no “XZ” available in either my Applications or my Utilities folder (and, yes, I chose my HD for the installation).

While I appreciate the intent of helping people install wget onto their macs, I would suggest that next time the author have a “beta tester” read and try to follow the instructions in the article. Rather than saving me any time, multiple attempts to follow the various links and installations just wasted an hour of my life.