Sarathlal N

Download webpage for offline reading - wget

During web browsing, often I feel that I have to save that web pages for further reading. In such situations, always I bookmark URL & later return to that web page in my free time.

But recently, I got enough free time. But there is no internet access! So I need to find out a way to download website completely for offline reading.

There is too many tools like HTTrack. Also we can use default wget command.

wget --mirror --convert-links --adjust-extension --page-requisites --no-parent http://example.org

The above command will download example.org webpage & and convert all links to access offline.

We can also shorten the above command.

wget -mkEpnp http://example.org

Explanation of the various flags that used in this command is given below.

  1. --mirror – Makes (among other things) the download recursive.
  2. --convert-links – convert all the links (also to stuff like CSS stylesheets) to relative, so it will be suitable for offline viewing.
  3. --adjust-extension – Adds suitable extensions to filenames (html or css) depending on their content-type.
  4. --page-requisites – Download things like CSS style-sheets and images required to properly display the page offline.
  5. --no-parent – When recursing do not ascend to the parent directory. It useful for restricting the download to only a portion of the site.

Looking for a skilled WordPress/WooCommerce developer? I'm currently available for freelance, contract, or full-time remote opportunities! Let's create something amazing together. Send me a quick message, and I'll respond within 24 hours!

Recent Posts

  1. REST API Methods Explained with Best Practices for Building Clean and Secure APIs
  2. My 28-Day Plan to Master Modern WordPress Development Using AI Tools
  3. Scaling WordPress - How Custom Database Tables Solve the Post Meta Bottleneck
  4. WordPress Transients Explained - A Developer's Guide to Site Performance
  5. Behind the Click - The Hidden Journey of Your Web Requests

Your Questions / Comments

If you found this article interesting, found errors, or just want to discuss about it, please get in touch.