title: Using selenium.getBodyText() to capture HTML source, using Java, how can I save it into a HTML file locally?
body: <p>This is probably a java noob question but here is my scenario:</p>
  
  <ol>
  <li>using selenium, I captured the html source with getBodyText()</li>
  <li>using java, I want to save the information from getBodyText() into a html file so I can review it later</li>
  </ol>
  
  <p>I currently have getBodyText() stored as a String, here's the code:</p>
  
  <pre><code>String stored_report = selenium.getBodyText();
  
  File f = new File("C:/folder/" + "report" + ".html");
  FileWriter writer = new FileWriter(f);
  writer.append(stored_report);
  System.out.println("Report Created is in Location : " + f.getAbsolutePath())
  writer.close();
  </code></pre>
  
  <p>Do I have to use FileReader? What do I need to do so the saved html file still shows the html format? (currently since it's stored as a string, the page shows up with everything appear on one line)</p>
  
  <p>Thanks in advance!</p>