title: R - Write a HTML file from URL/HTML Object/HTML Response
body: <p>I want to save a HTML file using a URL from R.
  I have tried to save the response object(s) after using <code>GET</code> and <code>read_html</code> functions of <code>httr</code> and <code>rvest</code> packages respectively, on the URL of the website, I want to save the HTML of. But that didn't work out to save the actual contents of the website.</p>
  
  <pre><code>url = "https://facebook.com"
  get_object = httr::GET(url); save(get_object, "file.html")
  html_object = rvest::read_html(url); save(html_object, "file.html")
  </code></pre>
  
  <p>Neither of these work to save the correct output (i.e, the HTML content of the webpage in a .html file) of the actual website in the HTML file.</p>