{"id":8445,"date":"2020-08-03T02:32:17","date_gmt":"2020-08-03T09:32:17","guid":{"rendered":"https:\/\/www.lee.org\/blog\/?p=8445"},"modified":"2020-08-10T18:26:28","modified_gmt":"2020-08-11T01:26:28","slug":"using-wget-to-download-a-website","status":"publish","type":"post","link":"https:\/\/www.lee.org\/blog\/2020\/08\/03\/using-wget-to-download-a-website\/","title":{"rendered":"Using Wget to Download a Website"},"content":{"rendered":"\n<p><a href=\"https:\/\/www.gnu.org\/software\/wget\/\">Wget<\/a> is a great tool for downloading individual webpages or entire websites. View the <a href=\"https:\/\/www.gnu.org\/software\/wget\/manual\/wget.html\">Wget manual<\/a>.<\/p>\n\n\n\n<p>When the site is password protected, you might do the following to download the site:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Download <a href=\"https:\/\/www.gnu.org\/software\/wget\/\">Wget.exe<\/a> for Windows (there is no installation)<\/li><li>Get the <a href=\"https:\/\/chrome.google.com\/webstore\/detail\/cookiestxt\/njabckikapfpffapmjgojcnbfjonfjfg?hl=en\">Cookies.txt Chrome extension<\/a><\/li><li>Log in to the site<\/li><li>Use the Cookies.txt extension to copy-paste the cookies into a file named cookies.txt in the same folder as wget.exe<\/li><li>Run a command that looks like this (maybe it&#8217;s overkill, but after banging on it for a while, this worked. So there):<\/li><\/ul>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>wget &#8211;recursive &#8211;no-parent &#8211;timestamping=on &#8211;no-clobber &#8211;page-requisites &#8211;html-extension &#8211;convert-links &#8211;restrict-file-names=windows &#8211;no-parent &#8211;load-cookies cookies.txt -e robots=off -U mozilla &#8220;https:\/\/www.EXAMPLE.COM\/WHATEVER\/&#8221;<\/p><\/blockquote>\n\n\n\n<p>I have had a little trouble with the cookies not working correctly. I&#8217;m not sure yet if it&#8217;s the cookie expiring after a few minutes and not getting renewed or Wget somehow fetching too aggressively. I successfully fetched a site by refreshing the homepage in Chrome (maybe keeping the cookie valid) and fetching from below the top level.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Wget is a great tool for downloading individual webpages or entire websites. View the Wget manual. When the site is password protected, you might do the following to download the site: Download Wget.exe for Windows (there is no installation) Get the Cookies.txt Chrome extension Log in to the site Use the Cookies.txt extension to copy-paste [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-8445","post","type-post","status-publish","format-standard","hentry","category-geekery"],"_links":{"self":[{"href":"https:\/\/www.lee.org\/blog\/wp-json\/wp\/v2\/posts\/8445","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.lee.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.lee.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.lee.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lee.org\/blog\/wp-json\/wp\/v2\/comments?post=8445"}],"version-history":[{"count":0,"href":"https:\/\/www.lee.org\/blog\/wp-json\/wp\/v2\/posts\/8445\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.lee.org\/blog\/wp-json\/wp\/v2\/media?parent=8445"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.lee.org\/blog\/wp-json\/wp\/v2\/categories?post=8445"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.lee.org\/blog\/wp-json\/wp\/v2\/tags?post=8445"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}