title: How do scrape table from the provided website using casperjs?
body: <p>The final goal is to retrieve stock data in table form from provided broker website and save it to some text file. Here is the code, that I managed to compile so far by reading few tutorials:</p>
  
  <pre><code>var casper = require("casper").create();
  var url = 'https://iqoption.com/en/historical-financial-quotes?active_id=1&amp;tz_offset=60&amp;date=2016-12-19-21-59';
  
  var terminate = function() {
      this.echo("Exiting ...").exit();
  };
  
  var processPage = function() {
  
      var rows = document.querySelectorAll('#mCSB_3_container &gt; table'); //get table from broker site (copy/paste via copy selector in chrome tools)
      //var nodes = document.getElementsByClassName('mCSB_container');
  
      this.echo(rows);
      this.echo(rows.length);
      for (var i = 0; i &lt; rows.length; i++)
      {
          var cell = rows[i].querySelector('.quotes-table-result__date');
          this.echo(cell); //print each cell
      }  
  
  };
  
  casper.start(url);
  casper.waitForSelector('#mCSB_3_container', processPage, terminate);
  casper.run();
  </code></pre>
  
  <p>This code should retrieve the stock price table and print out each cell. However, all what I get is 'undefined', which likely means that I got no objects returned by queryselector call. And please assume that I don't know any web programming (HTML,CSS).</p>