I want to crawl the HTML data.
And, I tried headless browser in CasperJS.
But, Can't able to click.
- The following is tried code in CapserJS.
var casper = require('casper').create();
var mouse = require('mouse').create(casper);
casper.start('http://sts.kma.go.kr/jsp/home/contents/climateData/smart/smartStatisticsSearch.do', function() {
this.echo('START');
});
casper.then(function() {
this.capture("1.png");
this.mouse.click('li[class="item1"]');
casper.wait(5000, function() {
this.capture("2.png");
});
});
casper.run(function() {
this.capture('3.png');
this.echo('EXIT');
casper.exit();
});
In code, "1.png" is capture file ago click event. "2.png" is capture file after click event. "3.png" is capture file after click event and after "run" method.
But, "1.png", "2.png", "3.png" are equal result.
Help me.