title: Export HTML to text file with different results
body: <p>I have two codes .. that are supposed to export the html file to text file</p>
  
  <pre><code>Sub Demo1()
  Dim http        As New XMLHTTP60
  Dim html        As New HTMLDocument
  
  With http
      .Open "GET", "https://www.google.com.eg/", False
      .send
      html.body.innerHTML = .responseText
  
      WriteTxtFile html.body.innerHTML
  End With
  End Sub
  
  Sub WriteTxtFile(ByVal aString As String, Optional ByVal filePath As String = "C:\Users\Future\Desktop\Output.txt")
  Dim fso         As Object
  Dim fileout     As Object
  
  Set fso = CreateObject("Scripting.FileSystemObject")
  Set fileout = fso.CreateTextFile(filePath, True, True)
  fileout.write aString
  fileout.Close
  End Sub
  
  Sub Demo2()
  Dim ie          As Object
  Dim f           As Integer
  
  Set ie = CreateObject("InternetExplorer.Application")
  
  With ie
      .Visible = True
      .navigate ("https://www.google.com.eg/")
  
      Do: DoEvents: Loop Until .readyState = 4
  
      f = FreeFile()
      Open ThisWorkbook.Path &amp; "\Sample.txt" For Output As #f
      Print #f, .document.body.innerHTML
      Close #f
  
      .Quit
  End With
  End Sub
  </code></pre>
  
  <p>Both Demo1 and Demo2 are the codes .. and they resulted in "Sample.txt" and "Output.txt"
  But I found those html documents are different results
  Can you help me to clarify what is the right one .. and why they are different?</p>
  
  <p>Thanks advanced for help</p>