title: HTML when downloaded with "Save As" slightly different than HTML downloaded using Python Requests
body: <p>I've using Beautiful Soup and Requests to webscrape a table, and to test I've downloaded a webpage by right-clicking and using "Save As" to download a full HTML file. But when I tested my webscraper against the actual website, the output was slightly off. So I used Requests to download the page into another html file using this code:</p>
  
  <pre><code>import requests
  
  r = requests.get("URL")
  with open('page_content.html', 'w') as fid:
      fid.write(r.text)
  fid.close()
  
  </code></pre>
  
  <p>And noticed that the relevant parts I wanted to webscrape (the table) were the same up to a few unclosed tags. The Save As html page had correctly closed tags, but the Requests page is missing the ends of some tags. For example, the Save As doc has all its tags closed:</p>
  
  <pre><code>&lt;td&gt;
      &lt;td&gt;stuff&lt;/td&gt;
  &lt;/td&gt;
  </code></pre>
  
  <p>But the Requests downloaded doc is missing some of the closing tags:</p>
  
  <pre><code>&lt;td&gt;
     &lt;td&gt;stuff
  &lt;/td&gt;
  </code></pre>
  
  <p>The site itself appears correctly formatted, and when I use Inspect, all the tags are closed. But when when I use View Page Source, I see the missing tags. The Requests-downloaded page shows up correctly formatted when opened in Chrome.</p>
  
  <p>This is causing me some trouble when trying to use BeautifulSoup to parse the data. </p>
  
  <p>How can I get the HTML doc with the correctly closed tags without going in and right-click-downloading each page I want?</p>