title: Anyway I can get the html body in node.js
body: <p>I try to send a request to an Apache server and use the returned body.</p>
  
  <p>Follow the manual of nodejs 
  <a href="http://nodejs.org/api/https.html#https_https_request_options_callback" rel="nofollow noreferrer">http://nodejs.org/api/https.html#https_https_request_options_callback</a></p>
  
  <p>and related SO content
  <a href="https://stackoverflow.com/questions/7967037/how-to-make-external-http-requests-with-node-js">How to make external HTTP requests with Node.js</a></p>
  
  <p>My src is </p>
  
  <pre><code>callback = function(response) {
    body='';
    console.log('HEADERS: ' + JSON.stringify(response.headers));
    response.on('data', function (chunk) {
      body+= chunk;
    }); 
  
    response.on('end', function () {
      console.log(body);
    }); 
  }
  </code></pre>
  
  <p>My question is that the body here will include all the HTML header tag, such as  <code>&lt;!DOCTYPE html&gt;</code>...etc, which cannot be parsed by JSON object. Because all my data in the HTML body is JSOn, I want to get only the HTML body. Are there anyway to achieve this goal? Thanks in advance.</p>