title: Accessing contents of HTML response with javascript
body: <p>I need to automate some API tests using frisby.js and javascript, but I am having trouble accessing some data of a HTML response, most propabily because the response is not in JSON format.</p>
  
  <p>Below is my code</p>
  
  <pre><code>var frisby = require('frisby');
  frisby.create('Get some information')
      .get(someUrl)
      .after(function (err, res, body) {
          console.log(body);
      })
      .toss()
  </code></pre>
  
  <p>Below is the result of <code>console.log(body);</code>function</p>
  
  <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;
  
  &lt;html&gt;
  &lt;head&gt;
    &lt;title&gt;MDpay default response template for web&lt;/title&gt;
  &lt;/head&gt;
  &lt;body OnLoad="OnLoadEvent();" &gt;
  &lt;form name="downloadForm"
        action="https://someurl"
        method="POST"&gt;
    &lt;input type="hidden"
           name="PaReq"
           value="eJxVUdtuwjAM/ZWKDyBJCWuLjCUuk8YDE2JMYk8opN6ogBTSdIK/X1LK2PISn5PYxz6G1c4STd9I15YQ5lRV6ouiIh92krgnZQdhMVrSGeGbbFWUBkWXd2Ngd+hTrN4p4xCUPo9nrygznkgOrIVwJDubIudc8HCA3Qgw6kg42m+V2W960828zOmwWVHlgDVPoMvaOHvFJPN6dwC1PeDOudOAMWABAHu0sKhDVPnkS5HjgtPc6Zyvx5PLm5YFlcXabd8/1TMfAgs/IFeOMOYi8d09RaI/4PFAJsAaHtQxqOJq+RH1eTf03jJwCkKjG+g3U/1lwLtpyegrZjLzvd8R0OVUGvI//ES/MeRUaYy8aLiBPYaYvARXtfN2xWkvTkUabG1wKFV4P0QqbrUCABYyWLsx1m7TR/+2/APkDqQg"&gt;
    &lt;input type="hidden"
           name="TermUrl" value="https:someurl"&gt;
    &lt;input type="hidden"
           name="MD"
           value="402277:56F8FBC5FC36742423302C8EFF56C796E7B123FC61132EA2AD89A389A02C4093:4243:##100100000"&gt;
    &lt;!-- To support javascript unaware/disabled browsers --&gt;
    &lt;div style="text-align: center;"&gt;
      &lt;img src="templates/preloader.gif"/&gt;&lt;br/&gt;
      &lt;noscript&gt;
        &lt;center&gt;Please click the submit button below.&lt;br&gt;
          &lt;input type="submit" name="submit" value="Submit"&gt;&lt;/center&gt;
      &lt;/noscript&gt;
    &lt;/div&gt;
  &lt;/form&gt;
  
  &lt;SCRIPT LANGUAGE="Javascript" &gt;
    function OnLoadEvent() {
      document.downloadForm.submit();
    }
  &lt;/SCRIPT&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>My question is do you know a way to reach <code>value</code>'s of <code>PaReq</code>, <code>TermUrl</code> and <code>MD</code> HTML tags.</p>
  
  <p>Thanks</p>