I am trying to use CasperJS to populate two fields, submit a form, and print out the content of the following page. However, it does not appear that I am successfully clicking the button to go to the next page. I attempted to follow the tutorials/examples on CasperJS and answers on SO like How to login into a website with CasperJS?. However, the difference is that I am not submitting a but rather a table with several filled out values.
Please find my code below:
var casper = require('casper').create();
casper.start('https://a836-propertyportal.nyc.gov/Default.aspx', function() {});
casper.evaluate(function(block, lot) {
document.querySelector('#ctl00_SampleContent_ctl01_txtBlock').value = block;
document.querySelector('#ctl00_SampleContent_ctl01_txtLot').value = lot;
document.querySelector('#ctl00_SampleContent_ctl01_btnSearchBBL').click();
}, '01000', '0011');
casper.run(function() {
// echo results in some pretty fashion
this.echo('we are this far in the code..');
// this.echo(this.getPageContent());
var links = document.querySelectorAll('td.contentDataElement');
this.echo(links.length);
for(var i=0; i<links.length; i++) {
this.echo(links[i]);
}
});