title: Execute Javascript function from HTML Request
body: <p>I'm new to JS and am trying to execute a function on a site to pull all the data in table in JSON format.</p>
  
  <p>I am using Parse Cloud Code to send my http requests, and the requests themselves are working, but I can't seem to get just the data itself.</p>
  
  <p>It seems I am only able to get it in HTML and even then the objects do not display the same way that they do in the webpage's elements.</p>
  
  <p>Any help/advice would be greatly appreciated!</p>
  
  <p>Thank you in advance.</p>
  
  <p>This is the link:</p>
  
  <p><a href="http://www.capetown.gov.za/Media-and-news#k=thinkwater" rel="nofollow noreferrer">http://www.capetown.gov.za/Media-and-news#k=thinkwater</a></p>
  
  <p>Here is the code:</p>
  
  <pre><code>Parse.Cloud.define('hello', function(req, res) {
    res.success('Hi');
  });
  
  Parse.Cloud.define('htmlTest', function(req, res) {
    Parse.Cloud.httpRequest({
      method: 'POST',
      url: 'http://www.capetown.gov.za/Media-and-news#k=thinkwater',
      params: {
        action: '/Media-and-news',
        id: 'aspnetForm',
        onsubmit: 'javascript:return WebForm_OnSubmit();'
      },
      headers: {
        'Content-Type': 'application/json;charset=utf-8'
      }
    }).then(function(httpResponse) {
      // success
      res.success(httpResponse.text);
    }, function(httpResponse) {
      // error
      res.error('Request failed with response code ' + httpResponse.status);
    });
  });
  </code></pre>