{"id":230,"date":"2010-01-20T20:12:16","date_gmt":"2010-01-21T03:12:16","guid":{"rendered":"http:\/\/www.funk.co.nz\/blog\/?p=230"},"modified":"2010-01-20T20:12:16","modified_gmt":"2010-01-21T03:12:16","slug":"how-to-use-wget-to-show-page-source-code","status":"publish","type":"post","link":"https:\/\/www.funk.co.nz\/blog\/technology\/unix\/how-to-use-wget-to-show-page-source-code","title":{"rendered":"How to use WGET to show HTML source code"},"content":{"rendered":"<p>If you are logged into a Unix shell, say like the Terminal on Mac OS X, or bash in Linux, sometimes you want to show a web pages source code. I use this for checking a pages source code from another location outside my network. This is helpful if you have a strong proxy server that is preventing you from getting the latest copy of a webpage during development.<\/p>\n<p>Display the HTML source code for Google.com:<\/p>\n<pre><span class=\"ident\">wget<\/span> <span class=\"punct\">-<\/span><span class=\"ident\">qO<\/span><span class=\"punct\">-<\/span> <span class=\"ident\">http<\/span><span class=\"punct\">:\/<\/span><span class=\"punct\">\/<\/span><span class=\"ident\">google<\/span><span class=\"punct\">.<\/span><span class=\"ident\">com<\/span> <span class=\"punct\">|<\/span> <span class=\"ident\">cat<\/span><\/pre>\n<p>There you have it.<\/p>\n<p>If you actually want to save the file to a local file and also display it, use this instead:<\/p>\n<pre>wget -q -O file \"url\"; cat file<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>If you are logged into a Unix shell, say like the Terminal on Mac OS X, or bash in Linux, sometimes you want to show a web pages source code. I use this for checking a pages source code from another location outside my network. This is helpful if you have a strong proxy server [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28],"tags":[44,29],"class_list":["post-230","post","type-post","status-publish","format-standard","hentry","category-unix","tag-unix","tag-wget"],"_links":{"self":[{"href":"https:\/\/www.funk.co.nz\/blog\/wp-json\/wp\/v2\/posts\/230","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.funk.co.nz\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.funk.co.nz\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.funk.co.nz\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.funk.co.nz\/blog\/wp-json\/wp\/v2\/comments?post=230"}],"version-history":[{"count":0,"href":"https:\/\/www.funk.co.nz\/blog\/wp-json\/wp\/v2\/posts\/230\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.funk.co.nz\/blog\/wp-json\/wp\/v2\/media?parent=230"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.funk.co.nz\/blog\/wp-json\/wp\/v2\/categories?post=230"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.funk.co.nz\/blog\/wp-json\/wp\/v2\/tags?post=230"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}