title: How to get innertext from body of a URL
body: <p>I am trying to get innerText of <code>https://www.example.com/</code> in a nodejs appplication. I tried using <code>request</code> npm module to fetch body of URL as shown below: </p>
  
  <pre><code>function getBodyText() {
      request({
          url:'https://www.example.com/'
      }, (error, response, body) =&gt; {
          console.log(body.innerText);
      });
  }
  </code></pre>
  
  <p>The above code displays body of the current page I am in (https:www.google.com). Am I missing anything?</p>