title: DOMParser parseFromString method not working as expected
body: <p>I'm trying to use the DOMParser to parse a string of html as a document object. This is what I've done:</p>
  
  <pre><code>&lt;code&gt;
    let parser = new DOMParser();
    let url = document.getElementsByClassName("a-link-emphasis")[0].href;
    fetch(url)
      .then(response =&gt; response.text())
      .then(data =&gt; {
        let doc = parser.parseFromString(data, "text/xml");
        console.log(doc);
      })
      .catch(function(error) {
        console.log(error);
      });
  &lt;/code&gt;
  </code></pre>
  
  <p>I parse the response from the url as text so that the data variable is equal to the html source code of the page specified. It should be equal to a stringified version <a href="https://www.amazon.co.uk/LEGO-31058-Dinosaurs-Triceratops-Pterodactyl/product-reviews/B01J41DNWM/ref=cm_cr_dp_d_show_all_btm?ie=UTF8&amp;reviewerType=all_reviews" rel="nofollow noreferrer"> of this page's source code.</a> This is the console.log of the data variable:
  <a href="https://i.stack.imgur.com/VuR0T.png" rel="nofollow noreferrer">image.</a></p>
  
  <p>However when I try to parse this string with the parseFromString method, the variable doc is equal to the following html elements</p>
  
  <pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;body&gt;&lt;parsererror style="display: block; white-space: pre; border: 2px solid #c77; padding: 0 1em 0 1em; margin: 1em; background-color: #fdd; color: black"&gt;&lt;h3&gt;This page contains the following errors:&lt;/h3&gt;&lt;div style="font-family:monospace;font-size:12px"&gt;error on line 1 at column 2: StartTag: invalid element name
  &lt;/div&gt;&lt;h3&gt;Below is a rendering of the page up to the first error.&lt;/h3&gt;&lt;/parsererror&gt;&lt;/body&gt;&lt;/html&gt;
  </code></pre>
  
  <p>Does anyone know what could be doing this?
  Thanks very much for your help.</p>